qyliang/CodeNanoFix huggingface dataset:
Buggy code:
# 2019-11-12 21:58:02(JST)
import sys
# import collections
# import math
# from string import ascii_lowercase, ascii_uppercase, digits
# from bisect import bisect_left as bi_l, bisect_right as bi_r
# import itertools
# from functools import reduce
# import operator as op
# from scipy.misc import comb # float
# import numpy as np 

def main():
    a, b, c = [int(x) for x in sys.stdin.readline().split()]
    if b >= a * c:
        ans = c
    else:
        ans = b % a
    print(ans)


if __name__ == "__main__":
    main()


Fixed code:
# 2019-11-12 21:58:02(JST)
import sys
# import collections
# import math
# from string import ascii_lowercase, ascii_uppercase, digits
# from bisect import bisect_left as bi_l, bisect_right as bi_r
# import itertools
# from functools import reduce
# import operator as op
# from scipy.misc import comb # float
# import numpy as np 

def main():
    a, b, c = [int(x) for x in sys.stdin.readline().split()]
    if b >= a * c:
        ans = c
    else:
        ans = b // a
    print(ans)


if __name__ == "__main__":
    main()
Buggy code:
a,b,c=map(int,input.split())
print(min(b//a,c))

Fixed code:
a, b, c = list(map(int, input().split()))
print(min(b//a, c))
Buggy code:
a, b, c = map(int, input().split())

num = 11 // 2

if num <= c:
  print(num)
else:
  print(c)

Fixed code:
a, b, c = map(int, input().split())

num = b // a

if num <= c:
  print(num)
else:
  print(c)
Buggy code:
a,b,c = map(int,input().split())
if a*c > b:
  print(c)
else:
  print(b//a)

Fixed code:
a, b, c = list(map(int, input().split()))
if b >= a*c:
  print(c)
else:
  print(b//a)
Buggy code:
a, b, c = [int(i) for i in input().split()]

print (min(a//b,c))


Fixed code:
a, b, c = [int(i) for i in input().split()]

print (min(b//a,c))
Buggy code:
a,b,c=map(int,input().split())
d=a//b
if (d+1)*b<=a:
  d+=1
print(min(d,c))

Fixed code:
a,b,c=map(int,input().split())
d=b//a
if (d+1)*a<=b:
  d+=1
print(min(d,c))
Buggy code:
a, b, c = map(int, input().split())

ans = b /a
ans = min(ans, c)
print(ans)


Fixed code:
a, b, c = map(int, input().split())

ans = b //a
ans = min(ans, c)
print(ans)
Buggy code:
a, b, c = (int(i) for i in input().split())

if a * c == b:
    print(c)
else:
    print(b//a)

Fixed code:
a, b, c = (int(i) for i in input().split())

if ((a * c) < b):
    print(c)
else:
    print(b//a)
Buggy code:
A,B,C =map(int,input().split())

print(min(C,B//A))​

Fixed code:
A, B, C = map(int, input().split())
print(min(C, (B//A)))
Buggy code:
str = int(input()).split()
a = str[0]
b = str[1]
c = str[2]

if b / a > c:
	print(c)

else:
	print(int(b / a))

Fixed code:
str = input().split()
a = int(str[0])
b = int(str[1])
c = int(str[2])
 
if b // a > c:
	print(c)
else:
	print(b // a)
Buggy code:
def main():
  A,B,C=map(int, input().split())

  if B>= A*C:
    print(C)
  else:
    print(B%A)

main()


Fixed code:
def main():
  A,B,C=map(int, input().split())

  if B>= A*C:
    print(C)
  else:
    print(B//A)

main()
Buggy code:
a,b,c=[int(i)for i in input().split()]
d=b//a
print(max(d,c))

Fixed code:
a,b,c=[int(i)for i in input().split()]
d=b//a
print(min(d,c))
Buggy code:
a, b, c = map(int, input().split())
print(min(c, (a //b)))

Fixed code:
a,b,c = map(int,input().split())

x = b//a

print(min(x,c))
Buggy code:
a, b, c = map(int, input().split())
print(c if a // b >= c else a // b)

Fixed code:
a, b, c = map(int, input().split())
print(c if b // a >= c else b // a)
Buggy code:
a,b,c = map(int,input().split())
d = a // b
if d >= c:
    print(c)
else:
    print(d)

Fixed code:
a,b,c = map(int,input().split())
d = b // a
if d >= c:
    print(c)
else:
    print(d)
Buggy code:
a,b,c = map(int,input().split())

if a//b > c:
  print(c)
elif a//b <= c:
  print(a//b)

Fixed code:
a,b,c = map(int,input().split())

if b//a > c:
  print(c)
elif b//a <= c:
  print(b//a)
Buggy code:
A, B, C = map(int, input().split())
if B//A>C:
    print(C)
else:
    print(b//A)


Fixed code:
A, B, C = map(int, input().split())
if B//A>C:
    print(C)
else:
    print(B//A)
Buggy code:
a,b,c = map(int,input().split())
print(a,b,c)

if(b//a >= c):
  print(c)
else:
  print(b//a)

Fixed code:
a,b,c = map(int,input().split())

if(b//a >= c):
  print(c)
else:
  print(b//a)
Buggy code:
a,b,c=map(int,input().split())
t= a//b
if t>c:
  print(c)
else:
  print(t)

Fixed code:
a,b,c=map(int,input().split())
t= b//a
if t>c:
  print(c)
else:
  print(t)
Buggy code:
a,b,c = map(int(i) for i in input().split())
if int(b/a) >= c:
  print(c)
else:
  print(int(i/a))

Fixed code:
a, b, c = (int(i) for i in input().split())
if b//a >= c:
    print(c)
else:
    print(b//a)
Buggy code:
import sys
input = sys.stdin.readline
def print_ans(A, B, C):
    """Test Case
    >>> print_ans(2, 11, 4)
    4
    >>> print_ans(3, 9, 5)
    3
    >>> print_ans(100, 1, 10)
    0
    """
    print(max(C, B // A))


if __name__ == '__main__':
    A, B, C = map(int, input().rstrip().split())
    print_ans(A, B, C)




Fixed code:
import sys
input = sys.stdin.readline
def print_ans(A, B, C):
    """Test Case
    >>> print_ans(2, 11, 4)
    4
    >>> print_ans(3, 9, 5)
    3
    >>> print_ans(100, 1, 10)
    0
    """
    print(min(C, B // A))


if __name__ == '__main__':
    A, B, C = map(int, input().rstrip().split())
    print_ans(A, B, C)
Buggy code:
A,B,C = map(int,input().split())

min(C,B // A)

Fixed code:
A,B,C = map(int,input().split())
     
print(min(C,B // A))
Buggy code:
a,b,c=map(int,input().split())
print(min(a//b,c)

Fixed code:
a, b ,c = map(int, input().split())
print(min(b//a, c))
Buggy code:
A,B,C = map(int, input().split())
if B//A > C:
    print(B//A)
else:
    print(C)

Fixed code:
A, B, C = map(int, input().split())
count = B // A
if count >= C:
    print(C)
else:
    print(count)
Buggy code:
A, B, C = list(map(int, input().split()))
ans = min(C, A//B)
print(ans)


Fixed code:
A,B,C = list(map(int, input().split()))
print(min(C, B//A))
Buggy code:
a=list(map(int, input().split().split()))

if a[1]//a[0]>=a[2]:
    print(a[2])
else:
    print(a[1]//a[0])


Fixed code:
a=list(map(int, input().split()))
 
if a[1]/a[0]>=a[2]:
    print(a[2])
else:
    print(a[1]//a[0])
Buggy code:
a,b,c = map(int,input().split())
print(c if b >= a*c else b//c)

Fixed code:
a,b,c = map(int,input().split())
print(c if b >= a*c else b//a)
Buggy code:
S = input()
S = S.split()
howMuch = S[0]
Ihave = S[1]
sutis = S[2]
 
if (Ihave // howMuch) < sutis:
    print(Ihave // howMuch)
else:
    print(sutis)

Fixed code:
S = input()
S = S.split()
howMuch = int(S[0])
Ihave = int(S[1])
sutis = int(S[2])
 
if (Ihave // howMuch) < sutis:
    print(Ihave // howMuch)
else:
    print(sutis)
Buggy code:
a,b,c = map(int,input().split())

d = b / a
if d > c:
    print(c)
else:
    print(d)

Fixed code:
a,b,c = map(int,input().split())

d = b // a
if d > c:
    print(c)
else:
    print(d)
Buggy code:
a, b, c= map(int, input().split())
print(min(c, b//a)

Fixed code:
a, b, c = list(map(int, input().split()))
print(min(b//a, c))
Buggy code:
a,b,c= map(int, input().split())

if (b/a) => c:
  print(c)
else:
  print(b/a)

Fixed code:
a, b, c = map(int, input().split())

if b // a >= c:
    print(c)
else :
    print(b // a)
Buggy code:
a, b, c = list(map(int, input().split()))
n = b % a
if a * c >= b:
  print(c)
else:
  print(int((b - n) / a))

Fixed code:
a, b, c = list(map(int, input().split()))
n = b % a
if a * c <= b:
  print(c)
else:
  print(int((b - n) / a))
Buggy code:
a,b,c = (int(i) for i in input().split())
if a*c <= a:print(c)
else:print(b//a)

Fixed code:
a,b,c = (int(i) for i in input().split())
if a*c <= b:print(c)
else:print(b//a)
Buggy code:
a, b, c = map(int, input().split())

if a * c >= b:
  ans = b
else:
  ans = b // a

print(ans)


Fixed code:
a, b, c = map(int, input().split())

if a * c <= b:
  ans = c
else:
  ans = b // a

print(ans)
Buggy code:

A, B, C=map(int,input().split())

Tmp = -(-B//A)
if A > C:
  print(C)
else:
  print(A)



Fixed code:
A, B, C=map(int,input().split())
 
Tmp = B//A
if Tmp > C:
  print(C)
else:
  print(Tmp)
Buggy code:
a, b, c = map(int, input().split())
ans = b / a
if ans > c:
	print(c)
else:
	print(b/a)

Fixed code:
a,b,c=map(int,input().split())
if b//a>=c:
  print(c)
else:
  print(int(b//a))
Buggy code:
A, B, C = [int(_) for _ in input().split()]
print(min([A // B, C]))


Fixed code:
A, B, C = [int(_) for _ in input().split()]
print(min([B // A, C]))
Buggy code:
A, B, C = map(int, input().split())
print(min(B // A), C)

Fixed code:

A, B, C = map(int, input().split())

print(min(B//A, C))
Buggy code:
A,B,C= map(int,input().split())
print(A,B,C)
x = B // A

if x <= C :
	print( x )
else:
	print( C )

Fixed code:
A,B,C= map(int,input().split())
#print(A,B,C)
x = B // A

if x <= C :
	print( x )
else:
	print( C )
Buggy code:
a,b,c = map(int,input().split())
count = 0
if a//b > c :
  an = (c)
else :
  an = (b//a)
print(an)
  

Fixed code:
a,b,c = map(int,input().split())
if b//a > c :
  an = (c)
else :
  an = (b//a)
print(an)
Buggy code:
a,b,c=map(int,input().split())

print(min(a//b,c))

Fixed code:
a,b,c=map(int,input().split())

print(min(b//a,c))
Buggy code:
A,B,C = map(int,input().split())

print(B//A,C)

Fixed code:
A,B,C = map(int,input().split())
 
print(min(B//A,C))
Buggy code:
a,b,c = map(int(),input().split())

if b >= a * c:
  print(c)
else:
  print(int(b//a))

Fixed code:
a, b, c = map(int, input().split())

if b // a >= c:
    print(c)

else:
    print(b // a)
Buggy code:
a,b,c=map(int,input().split())
print(min((a//b),c))

Fixed code:
a, b, c = map(int, input().split())

print(min(b // a, c))
Buggy code:
a, b, c = list(map(int, input().split()))
total_yen = a * c
if total_yen <= b:
    print(total_yen)
else:
    print(b//a)

Fixed code:
a, b, c = map(int, input().split())
if a * c <= b:
  print(c)
else:
  print(b // a)
Buggy code:
a, b, c = list(map(int, input().split(' ')))
min(b//a, c)

Fixed code:
a, b, c = list(map(int, input().split(' ')))
print(min(b//a, c))
Buggy code:
a,b,c=map(int,input().split())
d=b/a
if d>c:
  print(c)
else:
  print(d)

Fixed code:
a,b,c=map(int,input().split())
d=b//a
if d>c:
  print(c)
else:
  print(d)
Buggy code:
A,B,C=map(int,input().split())
if A*C<B:
  print(B)
else:
  print(B//A)

Fixed code:
A,B,C=map(int,input().split())
if A*C<B:
  print(C)
else:
  print(B//A)
Buggy code:
def main():
  A, B, C = map(int, input().split(" "))
  count = B // A
  return min(count, C)
  
if __name__ == '__main__':
  main()

Fixed code:
def main():
  A, B, C = map(int, input().split(" "))
  count = B // A
  print(min(count, C))
  
if __name__ == '__main__':
  main()
Buggy code:
A,B,C = map(int,input().split())
print(min(A/B,C))

Fixed code:
A, B, C=map(int, input().split())
print(min(C, B//A))
Buggy code:
a, b, c = map(int, input().split())
print(b // a)


Fixed code:
a,b,c = map(int,input().split())

print(min(c,b//a))
Buggy code:
a,b,c = map(int,input().split())
if c < a * b:
    print(c)
else:
    print(a*b)

Fixed code:
a, b, c = map(int, input().split())
if a*c <= b:
    print(c)
else:
    print(b//a)
Buggy code:
cost, money, enogh = map(int, input().split())

times = money // cost
if(times > enough):
    print(enough)
else:
    print(times)


Fixed code:
cost, money, enough = map(int, input().split())

times = money // cost
if(times > enough):
    print(enough)
else:
    print(times)
Buggy code:
import math

a, b, c = input().split()
a, b, c = int(a), int(b), int(c)

if b/a :
  print(c)

else:
  print(math.floor(b/a))

Fixed code:
import math

a, b, c = input().split()
a, b, c = int(a), int(b), int(c)

if b/a > c :
  print(c)

else:
  print(math.floor(b/a))
Buggy code:
# coding: utf-8

a, b, c = map(int, input().split())

x = max(b // a, c)
print(x)

Fixed code:
# coding: utf-8

a, b, c = map(int, input().split())

x = min(b // a, c)
print(x)
Buggy code:
a,b,c = map(int, input().split())

if (b>=a*c):
    print(c)
else:
    print(a//b)

Fixed code:
a,b,c = map(int, input().split())

if (b>=a*c):
    print(c)
else:
    print(b//a)
Buggy code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

if __name__ == '__main__':
    a, b,c = map(int, input().split())

    print( min (a//b ,c))



Fixed code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

if __name__ == '__main__':
    a, b,c = map(int, input().split())

    print( min (b//a ,c))
Buggy code:
a,b,c=(map(int,input().split()))
if a*c < b:
    print(c)
else:
    print(b//c)

Fixed code:
a,b,c=(map(int,input().split()))
if a*c < b:
    print(c)
else:
    print(b//a)
Buggy code:
a,b,c = map(int, input().split())
  
a=int(a)
b=int(b)
c=int(c)
x=int(x)

x=b//a
  
if x>=c:
  print(c)
else :
  print(x)


Fixed code:
a,b,c = map(int, input().split())
  
a=int(a)
b=int(b)
c=int(c)

x=b//a
x=int(x)

if x>=c:
  print(c)
else :
  print(x)
Buggy code:
A,B,C = map(int, input().split())

if A*C >= B:
  print(C)
else:
  print(int(B//A))

Fixed code:
A,B,C = map(int,input().split())
if B//A > C:
    print(C)
else:
    print(B//A)
Buggy code:
A,B,K = map(int,input().split())

a = []

if K == 1:
    print(K)
    exit()

for i in range(1,100):
    if A%i == 0 and B%i == 0:
        a.append(i)
if 
print(a[-K])

Fixed code:
A,B,K = map(int,input().split())

a = []

for i in range(1,100000):
    if A%i == 0 and B%i == 0:
        a.append(i)

print(a[-K])
Buggy code:
def main():
    a,b,k = list(map(int,input().split(' ')))
    cnt = 0
    for i in range(1,max(a,b)):
        if a%i ==0 and b %i ==0:
            cnt += 1
        if cnt ==k:
            print(i)
            break

if __name__ == '__main__':
    main()

Fixed code:
def main():
    a,b,k = list(map(int,input().split(' ')))
    cnt = 0
    for i in range(min(a,b),0,-1):
        if a%i ==0 and b %i ==0:
            cnt += 1
        if cnt ==k:
            print(i)
            break

if __name__ == '__main__':
    main()
Buggy code:
a, b, k = map(int,input().split())
List = []

for i in range(1,101):
    if a % i == 0 and b % i == 0:
        List.append(i)

print(List[k-1])

Fixed code:
a, b, k = map(int,input().split())
List = []

for i in range(1,101,1):
    if a % i == 0 and b % i == 0:
        List.append(i)

print(List[-k])
Buggy code:
import math

def main():
    A, B, K = map(int, input().split())
    
    c_list = []
    
    for i in range(1, min(A, B)+1):
        if A%i==0 and B%i==0:
            c_list.append(i)
    print(c_list[K])
main()

Fixed code:
import math

def main():
    A, B, K = map(int, input().split())
    
    c_list = []
    
    for i in range(1, min(A, B)+1):
        if A%i==0 and B%i==0:
            c_list.append(i)
    c_list.reverse()
    print(c_list[K-1])
main()
Buggy code:
A,B,K = map(int,input().split())

L = []

for i in range(1,max(A,B) + 1):

	if (A % i) == 0 and (B % i) == 0:
		L.append(i)
		
print(L[-K:-K+1])

Fixed code:
A,B,K = map(int,input().split())

L = []

for i in range(1,max(A,B) + 1):

	if (A % i) == 0 and (B % i) == 0:
		L.append(i)
		
print(L[-K])
Buggy code:
a, b, k = (int(i) for i in input().split())
cdiv = []
ans = []
a,b = min(a,b),max(a,b)
for i in range(1, a + 1):
    if a % i == 0:
        cdiv.append(i)
for i in cdiv:
    if b % i != 0:
        ans.append(i)


print(ans[len(ans) - k])


Fixed code:
a, b, k = (int(i) for i in input().split())
cdiv = []
ans = []
a,b = min(a,b),max(a,b)
for i in range(1, a + 1):
    if a % i == 0:
        cdiv.append(i)
for i in cdiv:
    if b % i == 0:
        ans.append(i)


print(ans[len(ans) - k])
Buggy code:
a,b,th = (int(i) for i in input().split())
lst = []
c = max(a,b)
for i in range(1,c+1):
    if a % i == 0 and b % i == 0:
        lst.append(i)
print(lst[th-1])


Fixed code:
a,b,th = (int(i) for i in input().split())
lst = []
c = max(a,b)
for i in range(c+1,0,-1):
    if a % i == 0 and b % i == 0:
        lst.append(i)
print(lst[th-1])
Buggy code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

A,B,K = [int(x) for x in input().split()]
ls =[]
for i in range(1,A+1):
    if A % i == 0 and B % i == 0:
        ls.append(i)

print(ls[K])

Fixed code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

A,B,K = [int(x) for x in input().split()]
ls =[i for i in range(1,A+1) if A % i == 0 and B % i == 0]
ls.reverse()
answer = ls[K-1]
print(answer)
Buggy code:
A,B,K=map(int,input().split())
ans=[]
for i in range(1,min(A,B)):
  if A%i==0 and B%i==0:
    ans.append(i)
print(ans[-K])

Fixed code:
A,B,K=map(int,input().split())
ans=[]
for i in range(1,min(A,B)+1):
  if A%i==0 and B%i==0:
    ans.append(i)
print(ans[-K])
Buggy code:
A,B,K = map(int,input().split())
count = 0
for i in range(100,1,-1):
    if A%i==0 and B%i==0:
        count+=1
    if count==K:
        print(i)
        exit()


Fixed code:
A,B,K = map(int,input().split())
count = 0
for i in range(max(A,B),-1,-1):
    if A%i==0 and B%i==0:
        count+=1
    if count==K:
        print(i)
        exit()
Buggy code:
A,B,K=map(int,input().split())
div=[]
for i in range(1,max(A,B)):
    if A%i==0 and B%i==0:
        div+=[i]

       
print(div[-K])

Fixed code:
A,B,K=map(int,input().split())
div=[]
for i in range(1,max(A,B)+1):
    if A%i==0 and B%i==0:
        div+=[i]
print(div[-K])
Buggy code:
a, b, n = map(int, input().split())
 
num = min(a, b)
answer = []
for i in range(1, num+1):
    if (a % i == 0 and b % i == 0):
        answer.append(i)
        
print(answer[n-1])

Fixed code:
a, b, k = map(int, input().split())
 
num = min(a, b)
answer = []
for i in range(1, num+1):
    if (a % i == 0 and b % i == 0):
        answer.append(i)
        
print(answer[-k])
Buggy code:
a, b, k = map(int, input().split())
da = []
db = []
dc = []
for i in range(1,a+1):
    if a%1 == 0:
    	da.append(i)

for j in range(1, b+1):
    if b%j == 0:
    	db.append(j)

for k in range da:
    if k in db:
    	dc.append(k)

dc.sort(reverse = True)
print(dc[k-1])

Fixed code:
a, b, k = map(int, input().split())
da = []
db = []
dc = []
for i in range(1,a+1):
    if a%i == 0:
    	da.append(i)

for j in range(1, b+1):
    if b%j == 0:
    	db.append(j)

for l in da:
    if l in db:
    	dc.append(l)

dc.sort(reverse = True)
print(dc[k-1])
Buggy code:
A,B,K=int(input().split())
listAB=[]
for i in range(min(A,B)):
    if A%(i+1)==0 and B%(i+1)==0:
        listAB.append(i+1)
listAB.sort(reverse=1)
if A==1 and B==1:
    print(1)
else :
    print(listAB[K-1])

Fixed code:
A,B,K=map(int,input().split())
listAB=[]
for i in range(min(A,B)):
    if A%(i+1)==0 and B%(i+1)==0:
        listAB.append(i+1)
listAB.sort(reverse=1)
if A==1 and B==1:
    print(1)
else :
    print(listAB[K-1])
Buggy code:
a,b,k = map(int,input().split())
n=max(a,b)
A=[]
for i in range(1,n+1):
    if  a%i==b%i==0:
         A.append(i)
A.sort(reverse = True)
print(A)
print(A[k-1])


Fixed code:
a,b,k = map(int,input().split())
n=max(a,b)
A=[]
for i in range(1,n+1):
    if  a%i==b%i==0:
         A.append(i)
A.sort(reverse = True)

print(A[k-1])
Buggy code:
a,b,k=map(int,input().split())

l=[]
cnt=0
i=0
while cnt < k:
    i = i+1
    if a%i == 0 and b%i == 0:
        cnt+=1
        l.append(i)
    else:
        continue

print(l[cnt-1])

Fixed code:
a,b,k=map(int,input().split())

l=[]
cnt=0
i=0
while i <= a or i <= b:
    i = i+1
    if a%i == 0 and b%i == 0:
        cnt+=1
        l.append(i)
    else:
        continue

print(l[-k])
Buggy code:
a,b,k=map(int,input().split())
cnt=0
for x in range(max(a,b),1,-1):
    if a%x ==0 and b%x == 0 :
        cnt=cnt+1
    if cnt == k :
        print(x)
        break

Fixed code:
a,b,k=map(int,input().split())
cnt=0
for x in range(max(a,b),0,-1):
    if a%x ==0 and b%x == 0 :
        cnt=cnt+1
    if cnt == k :
        print(x)
        break
Buggy code:
a,b,k=map(int,input().split())
s=[i for i in range(1,101)  if a%i==0 and b%i==0]
print(s[k-1])

Fixed code:
a,b,k=map(int,input().split())
s=[i for i in range(1,101)  if a%i==0 and b%i==0]
print(s[-k])
Buggy code:
def main():
  A, B, K = map(int, input().split(" "))
 
  i = 1
  result = []
  while i <= min(A, B):
    if A % i == 0 and B % i == 0:
      result.append(i)
    i += 1
  print(result[-K])
 
 if __name__ == '__main__':
  main()

Fixed code:
def main():
  A, B, K = map(int, input().split(" "))
 
  i = 1
  result = []
  while i <= min(A, B):
    if A % i == 0 and B % i == 0:
      result.append(i)
    i += 1
  print(result[-K])
  
if __name__ == '__main__':
  main()
Buggy code:

def resolve():
    a, b, k = map(int, input().split())
    t = []
    for i in range(1, k+1):
        if a % i == 0 and b % i == 0:
            t.append(i)
    print(t[k-1])
resolve()    

Fixed code:
def resolve():
    a, b, k = map(int, input().split())
    t = []
    for i in range(1, min(a,b)+1):
        if a % i == 0 and b % i == 0:
            t.append(i)
    print(t[-k])
resolve()
Buggy code:
A,B,K = map(int,input().split())
count = 0
for i in range(101,0,-1):
  if A%i == 0 and B%i == 0:
    count += 1
    print(i)
    if count == K:
      print(i)
      exit()


Fixed code:
A,B,K = map(int,input().split())
count = 0
for i in range(101,0,-1):
  if A%i == 0 and B%i == 0:
    count += 1
    if count == K:
      print(i)
      exit()
Buggy code:
a,b,k = map(int,input().split())
count = 0
for i in range(1,min(a,b)+1):
  if a%i==0 and b%i==0:
    count += 1
  if count == k:
    print(i)
    exit()

Fixed code:
a,b,k = map(int,input().split())
count = 0
for i in range(min(a,b),0,-1):
  if a%i==0 and b%i==0:
    count += 1
  if count == k:
    print(i)
    exit()
Buggy code:
a, b, k = map(int, input().split())
if a > b:
    a, b = b, a
div_lst = []
for i in range(1, a+1):
    if a % i == 0 and b % i == 0:
        div_lst.append(i)
# print(div_lst)
print(div_lst[k-1])

Fixed code:
a, b, k = map(int, input().split())
if a > b:
    a, b = b, a
div_lst = []
for i in range(1, a+1):
    if a % i == 0 and b % i == 0:
        div_lst.append(i)
# print(div_lst)
print(div_lst[-k])
Buggy code:
A,B,K = map(int,input().split())
cnt = 0

for i in range(1,min(A,B)+1,1): 
    if B % i == 0 and A % i == 0:
        cnt += 1
        if cnt == K:
            print(i)

Fixed code:
A,B,K = map(int, input().split())


cnt = 0

for i in reversed(range(1,min(A,B)+1)):
    if A%i ==0 and B%i == 0:
        cnt += 1
    if cnt == K:
        print(i)
        exit()
Buggy code:
A,B,K = list(map(int,input().split()))

nums = []

for i in range(1,min(A,B),1):
    if B % i == 0 and A % i == 0:
        nums.append(i)

if nums == []:
    print(1)
else:
    print(nums[K-1])

Fixed code:
A,B,K = list(map(int,input().split()))

nums = []
cnt = 0

for i in range(1,min(A,B)+1,1):    
    if B % i == 0 and A % i == 0:
        nums.append(i)

print(nums[-K])
Buggy code:
import math
a, b, k =map(int, input().split())
divesor_list = []
if min(a, b) == 1:
    divesor_list = [1]
else:
    for i in range(min(a, b), 0, -1):
            if gcd % i == 0:
                divesor_list.append(i)
print(divesor_list[k-1])

Fixed code:
import math
a, b, k =map(int, input().split())
divesor_list = []
c = min(a, b)
if c == 1:
    divesor_list = [1]
else:
    for i in range(c, 0, -1):
            if (a % i == 0) & (b % i == 0):
                divesor_list.append(i)
print(divesor_list[k-1])
Buggy code:
A, B ,K  = (int(x) for x in input().split())
i = 1
ans = []
while True:
    if min(A,B) < i:
        break
    if A % i == 0 & B % i == 0:
        ans.append(i)
    i = i + 1
print(ans[-K-1])

Fixed code:
A, B ,K  = (int(x) for x in input().split())
i = 1
ans = []
while True:
    if min(A,B) < i:
        break
    if (A % i == 0) & (B % i == 0):
        ans.append(i)
    i = i + 1
print(ans[len(ans)-K])
Buggy code:
A, B, K = [int(i) for i in input().split()]

l=[]

for i in range(1, max(A,B)+1):
  if A % i == 0 and B % i == 0:
    l.append(i)
    
print(sorted(l)[-1*K])
print(sorted(l))

Fixed code:
A, B, K = [int(i) for i in input().split()]

l=[]

for i in range(1, max(A,B)+1):
  if A % i == 0 and B % i == 0:
    l.append(i)
    
print(sorted(l)[-1*K])
Buggy code:
a, b, k = map(int, input().split())

cnt = 0

for i in range(1, min(a,b)+1):
    if a % i == 0 and b % i == 0:
        cnt += 1

    if cnt == k:
        break

print(i)

Fixed code:
a, b, k = map(int, input().split())

cnt = 0

for i in range(min(a,b), 0, -1):
    if a % i == 0 and b % i == 0:
        cnt += 1

    if cnt == k:
        break

print(i)