Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- e = []
- a,b,k = map(int,input().split())
- if a > b:
- for i in range(1, b+1):
- if a%i ==0 and b%i == 0:
- e.append(i)
- elif a == b:
- e.append(1)
- e.append(a)
- else:
- for p in range(1, a+1, 1):
- if b%p ==0 and a%p == 0:
- e.append(p)
- try:
- print (e[k-1])
- except IndexError:
- print (0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement