#916
Bronze I
RESETO
시간 제한
1s
메모리 제한
32MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

The sieve of Eratosthenes is a famous algorithm to find all prime numbers up to N. The algorithm is: 1. Write down all integers between 2 and N, inclusive. 2. Find the smallest number not already crossed out and call it P; P is prime. 3. Cross out P and all its multiples that aren't already crossed out. 4. If not all numbers have been crossed out, go to step 2. Write a program that, given N and K, find the K-th integer to be crossed out.

입력

The integers N and K (2 ≤ K < N ≤ 1000).

출력

Output the K-th number to be crossed out.

예제 입력 1

7 3

예제 출력 1

6

예제 입력 2

15 12

예제 출력 2

7

예제 입력 3

10 7

예제 출력 3

9
코드 제출

코드를 제출하려면 로그인이 필요합니다.

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