COCI00211
Broj
레이팅
의견: 0
설명
\(4^{th}\) round, February \(18^{th}\), 2012
Find the \(N-th\) smallest positive integer whose least prime factor is P, or state that the result is greater
than \(10^{9}\).
제약
In test cases worth 30% of total points, expected result will either be less than 100 000, or will exceed
\(10^{9}\).
In test cases worth additional 30% of total points, P will be greater than 1000.
입력 형식
The first and only line of input contains space seperated integers N and P (\(1 \le N\), \(P \le 10^{9}\)). P will
always be prime.
출력 형식
Output a single line with the expected result, or zero if result exceeds \(10^{9}\).
예제 1
입력
1 2출력
2예제 2
입력
2 3출력
9예제 3
입력
1000 1000003출력
0문제 정보
평가 및 의견
Broj
개요
Log in to rate problems.
개별 의견
아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.
풀이 제출
Broj
게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다.
로그인하고 제출하기