#1253
Unrated
PROSTI
스페셜 저지채점 준비중
시간 제한
0.5s
메모리 제한
64MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

0.5 seconds, 64 MB, 140 points Mirko and his older brother Slavko are playing a game. At the beginning of the game, they pick three numbers K, L, M. In the first and only step of the game, each of them picks their own K consecutive integers. Slavko always picks the first K integers (numbers 1, 2, ..., K). Mirko has a special demand – he wants to choose his numbers in a way that there are exactly L happy numbers among them. He considers a number happy if it meets at least one of the following requirements:

  • the number is smaller than or equal to M

  • the number is prime

Out of respect to his older brother, L will be smaller than or equal to the total number of happy numbers in Slavko’s array of numbers. They will play a total of Q games with different values K, L, M. For each game, help Mirko find an array that meets his demand.

입력

The first line of input contains Q (1 ⩽Q ⩽100 000). Each of the following Q lines contains three integers, the ith line containing integers Ki, Li, Mi (1 ⩽Ki, Mi ⩽150, 0 ⩽Li ⩽Ki) that determine the values K, L, M that will be used in the ith game.

출력

Output Q lines, the ith line containing an integer, the initial number of Mirko’s array in the ith game. If an array with the initial number being smaller than or equal to 10 000 000 does not exist, output −1. If there are multiple possible solutions, output any.

예제 입력 1

3
1 1 1
2 0 2
3 1 1

예제 출력 1

1
8
4

예제 입력 2

3
4 1 1
5 2 3
5 0 3

예제 출력 2

6
4
24

예제 입력 3

4
7 2 5
6 1 1
10 4 5
6 2 2

예제 출력 3

6
20
5
4
코드 제출

이 문제는 현재 제출할 수 없습니다.

이 현상이 잘못되었다고 생각될 경우 관리자한테 문의주세요.

내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Unrated0명 투표
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.