RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
COCI00397

Prosti

Unrated 레이팅 미적용
난이도
0.500s
시간 제한
64MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

\(7^{th}\) round, March \(5^{th}\) 2016
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 \(i\)^{th} line containing integers \(K_{i}\), \(L_{i}\), \(M_{i}\) (1 ⩽\(K_{i}\), M_{i} ⩽150, 0 ⩽\(L_{i}\)\(K_{i}\)) that determine
the values \(K\), \(L\), \(M\) that will be used in the \(i\)^{th} game.

출력 형식

Output \(Q\) lines, the \(i\)^{th} line containing an integer, the initial number of Mirko’s array in the \(i\)^{th} 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
3
4 1 1
5 2 3
5 0 3
4
7 2 5
6 1 1
10 4 5
6 2 2
출력
output
output
1
8
4
6
4
24
6
20
5
4
문제 정보

생성자가 기록되지 않았습니다.

출처 COCI 2015/2016 Contest 7

평가 및 의견

Prosti

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

Prosti

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8