MapleStory Finger Point

๐Ÿƒ‍โ™‚๏ธBaekjoon/Python

#2501 - python ์•ฝ์ˆ˜ ๊ตฌํ•˜๊ธฐ

HYEJU01 2024. 5. 17. 16:10

์•ฝ์ˆ˜ ๊ตฌํ•˜๊ธฐ

N,K = map(int,input().split())
cnt = 0
flag = 0
for i in range (1,N+1):
    if ( N % i == 0):
        tmp = i
        cnt+=1
    if (cnt == K):
        print (i)
        flag = 0
        break
    elif (cnt < K):
        flag = 1

if (flag == 1):
    print(0)