Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
cnt = 0
while N>0 and M>1:
    N -= 1
    M -= 2
    cnt += 1

while M>3:
    M -= 4
    cnt += 1
print(cnt)

Fixed submission:
N, M = map(int, input().split())
cnt = 0

if N<=M//2:
    cnt = N
    N,M =0,M-2*N
    cnt += M//4
    print(cnt)
else:
    cnt = M//2
    print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
cnt = 0
while N>0 and M>1:
    N -= 1
    M -= 2
    cnt += 1

while M>3:
    M -= 4
    cnt += 1
print(cnt)

Fixed submission:
N, M = map(int, input().split())
cnt = 0

if N<=M//2:
    cnt = N
    N,M =0,M-2*N
    cnt += M//4
    print(cnt)
else:
    cnt = M//2
    print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())
cnt = 0
for i in range(k+1):
    for j in range(k+1):
        for k in range(k+1):
            if i+j+k==s:
                cnt+=1
print(cnt)

Fixed submission:
k, s = map(int, input().split())
cnt = 0
for i in range(k+1):
    for j in range(k+1):
        if i+j<=s and s-(i+j)<=k:
            cnt+=1
print(cnt)
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = [int(i) for i in input().split()]

if max(l) < sum(l) - max(l) :
    print("Yes")
else:
    print("no")

Fixed submission:
t, x = map(int, input().split())
print(t / x)
Buggy python submission (verdict: Runtime Error):
ab, bc, ca = map(int(i) for i in input().split)

print(ab * bc / 2)

Fixed submission:
ab, bc, ca = map(int,input().split())

print(int(ab * bc / 2))

Buggy python submission (verdict: Runtime Error):
ab, bc, ca = list(map(int(i) for i in input().split))

print(ab * bc / 2)

Fixed submission:
ab, bc, ca = map(int,input().split())

print(int(ab * bc / 2))
Buggy python submission (verdict: Time Limit Exceeded):
def isLunlun(n):
  digs = list(map(int, str(n)))
  N = len(digs)
  if N == 1:
    return True
  i = 0
  while i < (N - 1):
    if abs(digs[i]-digs[i+1]) > 1:
      return False
  return True
n = int(input())
st = 0
while n:
  st += 1
  if isLunlun(st):
    n -= 1
print(st)  

Fixed submission:
from collections import deque
k = int(input())
queue = deque([1,2,3,4,5,6,7,8,9])
for i in range(k):
	x = queue[0]
	queue.popleft()
	if x % 10 != 0:
		queue.append(10*x + (x%10) - 1)
	queue.append(10*x + x%10)
	if x % 10 != 9:
		queue.append(10*x + (x % 10) + 1)
print(x)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()
i = 0
ans = 0
while i < n:
  if s[i] == 'A' and s[i:i+3] == 'ABC':
    ans += 1
print(ans)

Fixed submission:
n = int(input())
s = input()
i = 0
ans = 0
while i < n:
  if s[i]=='A' and s[i:i+3]=='ABC':
    ans += 1
    i += 3
  else:
    i += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
l1=list(map(int,input().split()))
totalcost=0
dp=[0]*n
def solve(dp,i,l1):
    if i==0:
        return 0
    if dp[i]!=0:
        return(dp[i])
    if i>1:
        dp[i]=min(solve(dp,i-2,l1)+abs(l1[i]-l1[i-2]),solve(dp,i-1,l1)+abs(l1[i]-l1[i-1]))
        return(dp[i])
    else :
        dp[i]=solve(dp,0,l1)+abs(l1[1]-l1[0])
        return(dp[i])
solve(dp,n-1,l1)
print(dp[n-1])
    

Fixed submission:
n=int(input())
l1=list(map(int,input().split()))
dp=[0]*n
for i in range(1,n):
    if i==1:
        dp[i]=abs(l1[i]-l1[i-1])
    else :
        dp[i]=min(dp[i-1]+abs(l1[i]-l1[i-1]),dp[i-2]+abs(l1[i]-l1[i-2]))
print(dp[n-1])
Buggy python submission (verdict: Time Limit Exceeded):
s=input()
t=input()
L=[ [0]*(len(t)+1) for _ in range(len(s)+1) ]

def lcs(s,t):
    n=len(s)
    m=len(t)
    for i in range(0,n+1):
        for j in range(0,m+1):
            if i==0 or j==0:
                L[i][j]=0
            elif s[i-1]==t[j-1]:
                L[i][j]=L[i-1][j-1]+1
            else :
                L[i][j]=max(L[i-1][j],L[i][j-1])
lcs(s,t)
ans=[]
i=len(s)
j=len(t)
while L[i][j]!=0:
    if L[i][j]!=L[i-1][j] or L[i][j]!=L[i][j-1]:
        ans.append(s[i-1])
        i-=1
        j-=1
    else :
        if L[i][j]==L[i-1][j]:
            i-=1
            continue
        else :
            j-=1
            continue
print(''.join(ans[::-1]))

Fixed submission:
"Template made by : https://codeforces.com/profile/c1729 , github repo : https://github.com/cheran-senthil/PyRival"
from __future__ import division, print_function
import bisect
import math
import itertools
import sys
from atexit import register

if sys.version_info[0] < 3:
    from io import BytesIO as stream
else:
    from io import StringIO as stream


if sys.version_info[0] < 3:
    class dict(dict):
        """dict() -> new empty dictionary"""
        def items(self):
            """D.items() -> a set-like object providing a view on D's items"""
            return dict.iteritems(self)

        def keys(self):
            """D.keys() -> a set-like object providing a view on D's keys"""
            return dict.iterkeys(self)

        def values(self):
            """D.values() -> an object providing a view on D's values"""
            return dict.itervalues(self)

    input = raw_input
    range = xrange

    filter = itertools.ifilter
    map = itertools.imap
    zip = itertools.izip


def sync_with_stdio(sync=True):
    """Set whether the standard Python streams are allowed to buffer their I/O.

    Args:
        sync (bool, optional): The new synchronization setting.

    """
    global input, flush

    if sync:
        flush = sys.stdout.flush
    else:
        sys.stdin = stream(sys.stdin.read())
        input = lambda: sys.stdin.readline().rstrip('\r\n')

        sys.stdout = stream()
        register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))

def main():
    s=input()
    t=input()
    L=[ [0]*(len(t)+1) for _ in range(len(s)+1) ]
    
    def lcs(s,t):
        n=len(s)
        m=len(t)
        for i in range(0,n+1):
            for j in range(0,m+1):
                if i==0 or j==0:
                    L[i][j]=0
                elif s[i-1]==t[j-1]:
                    L[i][j]=L[i-1][j-1]+1
                else :
                    L[i][j]=max(L[i-1][j],L[i][j-1])
    lcs(s,t)
    ans=[]
    i=len(s)
    j=len(t)
    while L[i][j]!=0:
        if L[i][j]!=L[i-1][j] and L[i][j]!=L[i][j-1]:
            ans.append(s[i-1])
            i-=1
            j-=1
        else :
            if L[i][j]==L[i-1][j]:
                i-=1
                continue
            else :
                j-=1
                continue
    print(''.join(ans[::-1]))
if __name__ == '__main__':
    sync_with_stdio(False)
    main()
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
## DAG graph , making using dict
in_degree=[0]*n ## number of incoming edges 
graph = {} ## graph [ u ] defines edge from u to v
for i in range(m):
    u, v=map(int,input().split()) 
    if u not in graph:
        graph[u]=[v]
    else :
        graph[u].append(v)
    in_degree[v-1]+=1
dist=[0]*n
curr_stack=[] ## starting from nodes with 0 incoming edges
for i in range(n):
    if in_degree[i]==0:
        curr_stack.append(i+1)
def dfs (curr_stack):
    while curr_stack:
        u=curr_stack.pop()
        if u not in graph:
            continue
        for item in graph[u]:
            dist[item-1]=max(dist[item-1],dist[u-1]+1)
            in_degree[item-1]-=1
            if in_degree[item-1]==0:
                curr_stack.append(item)
dfs(curr_stack)
print(max(dist))



Fixed submission:
n,m=map(int,input().split())
## DAG graph , making using dict
in_degree=[0]*n ## number of incoming edges 
graph = {} ## graph [ u ] defines edge from u to v
for i in range(m):
    u, v=map(int,input().split()) 
    if u not in graph:
        graph[u]=[v]
    else :
        graph[u].append(v)
    in_degree[v-1]+=1
dist=[0]*n
curr_stack=[] ## starting from nodes with 0 incoming edges
for i in range(n):
    if in_degree[i]==0:
        curr_stack.append(i+1)
def dfs (curr_stack):
    while curr_stack:
        u=curr_stack.pop()
        if u not in graph:
            continue
        for item in graph[u]:
            dist[item-1]=max(dist[item-1],dist[u-1]+1)
            in_degree[item-1]-=1
            if in_degree[item-1]==0:
                curr_stack.append(item)
dfs(curr_stack)
print(max(dist))
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import collections
N,X,Y = map(int,input().split())
ToltN=N*(N-1)/2
Dist=[[0 for i in range(N)] for i in range(N)]
for i in range(N):
    for j in range(i,N):    
        MyDist=abs(i-(X-1))+abs(j-(Y-1))+1
        if MyDist<j-i:
            Dist[i][j]=MyDist
        else:
            Dist[i][j] = j-i
for j in range(N-1):
    ans=[0]
    for i in range(N):
        ans+=Dist[i]
c = collections.Counter(ans)
for i in range(N-1):
    print(c[i+1])


Fixed submission:
# -*- coding: utf-8 -*-
S= list(input())

if S[2]==S[3] and S[4]==S[5]:
    YorN="Yes"
else:
    YorN="No"
print(YorN)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import collections
N,X,Y = map(int,input().split())
ToltN=N*(N-1)/2
Dist=[[0 for i in range(N)] for i in range(N)]
for i in range(N):
    for j in range(i,N):    
        MyDist=abs(i-(X-1))+abs(j-(Y-1))+1
        if MyDist<j-i:
            Dist[i][j]=MyDist
        else:
            Dist[i][j] = j-i
for j in range(N-1):
    ans=[0]
    for i in range(N):
        ans+=Dist[i]
c = collections.Counter(ans)
for i in range(N-1):
    print(c[i+1])


Fixed submission:
# -*- coding: utf-8 -*-
import collections
N,X,Y = map(int,input().split())
ToltN=N*(N-1)/2
Dist=[[0 for i in range(N)] for i in range(N)]
c=[0]*N
for i in range(N):
    for j in range(i+1,N):
        MyDist=abs(i-(X-1))+abs(j-(Y-1))+1
        if MyDist<j-i:
            Dist[i][j]=MyDist
            c[MyDist-1]+=1
        else:
            Dist[i][j] = j-i
            c[j-i-1]+=1
for i in range(N-1):
    print(c[i])

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
N,X,Y = map(int,input().split())
ToltN=N*(N-1)/2
Dist=[[0 for i in range(N)] for i in range(N)]
for i in range(N):
    for j in range(i,N):
        Dist[i][j] = j-i
        MyDist=abs(i-(X-1))+abs(j-(Y-1))+1
        if MyDist<Dist[i][j]:
            Dist[i][j]=MyDist


for j in range(N-1):
    ans=0
    for i in range(N):
        ans+=Dist[i].count(j+1)

    print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
import collections
N,X,Y = map(int,input().split())
ToltN=N*(N-1)/2
Dist=[[0 for i in range(N)] for i in range(N)]
c=[0]*N
for i in range(N):
    for j in range(i+1,N):
        MyDist=abs(i-(X-1))+abs(j-(Y-1))+1
        if MyDist<j-i:
            Dist[i][j]=MyDist
            c[MyDist-1]+=1
        else:
            Dist[i][j] = j-i
            c[j-i-1]+=1
for i in range(N-1):
    print(c[i])

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
N,X,Y = map(int,input().split())
ToltN=N*(N-1)/2
Dist=[[0 for i in range(N)] for i in range(N)]
for i in range(N):
    for j in range(i,N):
        Dist[i][j] = j-i
for i in range(N):
    for j in range(i,N):
        MyDist=abs(i-(X-1))+abs(j-(Y-1))+1

        if MyDist<Dist[i][j]:
            Dist[i][j]=MyDist
for j in range(N-1):
    ans=0
    for i in range(N):
        ans+=Dist[i].count(j+1)

    print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
import collections
N,X,Y = map(int,input().split())
ToltN=N*(N-1)/2
Dist=[[0 for i in range(N)] for i in range(N)]
c=[0]*N
for i in range(N):
    for j in range(i+1,N):
        MyDist=abs(i-(X-1))+abs(j-(Y-1))+1
        if MyDist<j-i:
            Dist[i][j]=MyDist
            c[MyDist-1]+=1
        else:
            Dist[i][j] = j-i
            c[j-i-1]+=1
for i in range(N-1):
    print(c[i])
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

def mergef(a,b):
    c = []
    h = j = 0
    while j<len(a) and h<len(b):
        if a[j]>b[h]:
            c.append(a[j])
            j+=1
        else:
            c.append(b[h])
            h+=1
    if j==len(a):
        for i in b[h:]:
            c.append(i)
    else:
        for i in a[j:]:
            c.append(i)
    return c

def merge_sortf(lists):
    if len(lists) <= 1:
        return lists
    middle = int(len(lists)/2)
    left = merge_sortf(lists[:middle])
    right = merge_sortf(lists[middle:])
    return mergef(left,right)


X,Y,A,B,C= map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))

pm=merge_sortf(p)
qm=merge_sortf(q)
rm=merge_sortf(r)

k=0;i=X-1;j=Y-1
while i>=0 and j>=0 and k<C:
    if min((pm[i]-rm[k]),(qm[j]-rm[k])) < 0 :
        if pm[i]>=qm[j] :
            qm[j]=rm[k]
            j=j-1
        elif pm[i]<qm[j]:
            pm[i]=rm[k]
            i=i-1
        else:

    elif min((pm[i]-rm[k]),(qm[j]-rm[k])) > 0:
        break
    k=k+1

ans=sum(pm[:X])+sum(qm[:Y])
print(ans)


Fixed submission:
# -*- coding: utf-8 -*-

def mergef(a,b):
    c = []
    h = j = 0
    while j<len(a) and h<len(b):
        if a[j]>b[h]:
            c.append(a[j])
            j+=1
        else:
            c.append(b[h])
            h+=1
    if j==len(a):
        for i in b[h:]:
            c.append(i)
    else:
        for i in a[j:]:
            c.append(i)
    return c

def merge_sortf(lists):
    if len(lists) <= 1:
        return lists
    middle = int(len(lists)/2)
    left = merge_sortf(lists[:middle])
    right = merge_sortf(lists[middle:])
    return mergef(left,right)


X,Y,A,B,C= map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))

pm=merge_sortf(p)
qm=merge_sortf(q)
rm=merge_sortf(r)

k=0;i=X-1;j=Y-1
while i>=0 and j>=0 and k<C:
    if min((pm[i]-rm[k]),(qm[j]-rm[k])) < 0 :
        if pm[i]>=qm[j] :
            qm[j]=rm[k]
            if j>0:
                j=j-1
        elif pm[i]<qm[j]:
            pm[i]=rm[k]
            if i>0:
                i=i-1
    elif min((pm[i]-rm[k]),(qm[j]-rm[k])) > 0:
        break
    k=k+1

ans=sum(pm[:X])+sum(qm[:Y])
print(ans)
Buggy python submission (verdict: Runtime Error):
n = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(n[k+1])

Fixed submission:
n = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())-1
print(n[k])

Buggy python submission (verdict: Runtime Error):
n = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(n[k+1]

Fixed submission:
n = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())-1
print(n[k])
Buggy python submission (verdict: Runtime Error):
r, g, b = map(int, input().split())
ans=100*r+10*g+b
if ans*4==0:
    print("YES")
else:
    print("NO")


Fixed submission:
k, x = map(int, input().split())
cost=500*k
if x <=cost:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import math
a,b=map(int,input().split())
print((a*b)//(math.gcd(a,b)))


Fixed submission:
import fractions
a,b=map(int,input().split())
print((a*b)//(fractions.gcd(a,b)))
Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())
count=0
for i in range(k+1):
    for j in range(k+1):
        for l in range(k+1):
            t=i+j+l
            if t == s:
                count += 1
            else:
                pass
print (count)


Fixed submission:
k, s = map(int, input().split())
count=0
for i in range(k+1):
    for j in range(k+1):
        t = s-i-j
        if t <= k and t >= 0:
            count += 1
        else:
            pass
print (count)
Buggy python submission (verdict: Runtime Error):
n,m,c=map(int,input().split())
b=list(map(int,input().split()))
a=[list(map(int,input().split())) for k in range(n)]
 
count=0
 
for i in range(n):
  absum=0
  for j in range(m):
    absum +=a[i][j]*b[j]
   
  ans=absum+c
  if ans>0:
    count+=1
      
print(count)

Fixed submission:
H,W = map(int,input().split())

h,w = map(int,input().split())

print((H-h)*(W-w))

Buggy python submission (verdict: Runtime Error):
n,m,c=map(int,input().split())
b=list(map(int,input().split()))
a=[list(map(int,input().split())) for k in range(n)]
 
count=0
 
for i in range(n):
  absum=0
  for j in range(m):
    absum+=a[i][j]*b[j]
    
    ans=absum+c
    if ans>0:
      count+=1
      
print(count)

Fixed submission:
H,W = map(int,input().split())

h,w = map(int,input().split())

print((H-h)*(W-w))
Buggy python submission (verdict: Runtime Error):
n,m,c=map(int,input().split())
b=list(map(int,input().split()))
a=[list(map(int,input().split())) for k in range(n)]
 
count=0
 
for i in range(n)
       absum=0
       for j in range(m)
       absum +=a[i][j]*b[j]
       
       ans=absum+c
       if ans>0:
       count +=1
print(count)       

Fixed submission:
n,m,c=map(int,input().split())
B=list(map(int,input().split()))
A=[list(map(int,input().split()))for i in range(n)] #二次元配列でとっています
cnt=0
for i in range(n):
    total=0
    for j in range(m):
        total+=B[j]*A[i][j]
    total+=c
    if 0<total:
        cnt+=1
print(cnt)

Buggy python submission (verdict: Runtime Error):
n,m,c=map(int,input().split())
b=list(map(int,input().split())
a=[list(map(int,input().split())) for k in range(n)]

count=0

for i in range(n)
       absum=0
       for j in range(m)
       absum +=a[i][j]*b[j]
       
       ans=absum+c
       if ans>0:
       count +=1
print(count)       

Fixed submission:
n,m,c=map(int,input().split())
B=list(map(int,input().split()))
A=[list(map(int,input().split()))for i in range(n)] #二次元配列でとっています
cnt=0
for i in range(n):
    total=0
    for j in range(m):
        total+=B[j]*A[i][j]
    total+=c
    if 0<total:
        cnt+=1
print(cnt)

Buggy python submission (verdict: Runtime Error):
gt

Fixed submission:
n,m,c=map(int,input().split())
B=list(map(int,input().split()))
A=[list(map(int,input().split()))for i in range(n)] #二次元配列でとっています
cnt=0
for i in range(n):
    total=0
    for j in range(m):
        total+=B[j]*A[i][j]
    total+=c
    if 0<total:
        cnt+=1
print(cnt)

Buggy python submission (verdict: Runtime Error):
n,m,c=map(int,input().split())
B=list(map(int,input().split())) 
A=[list(map(int,input().split()))for i in range(n)] 
cnt=0 
for i in range(n):
    total = 0
  for j in range(m):
      total+=B[j]*A[i][j]
  total+=c
  if total>0:
          cnt+=1  
print(cnt)

Fixed submission:
n,m,c=map(int,input().split())
B=list(map(int,input().split()))
A=[list(map(int,input().split()))for i in range(n)] #二次元配列でとっています
cnt=0
for i in range(n):
    total=0
    for j in range(m):
        total+=B[j]*A[i][j]
    total+=c
    if 0<total:
        cnt+=1
print(cnt)
Buggy python submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
 
count=0
 
for i in range(1,max(a,b)+1)[::-1]
 
if a%i==0 and b%i==0:
  count+=1
  if count==k:
    print(i)

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

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

Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())

answer = b//a

if answer<c:
  print(answer)
  else:
    print(c)

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

if b//a <= c:
  print(b//a)
  
else:
  print(c)
Buggy python submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
 
count=0
 
for i in range(1,min(a,b)+1)[::-1]:
  if a%i==0 and b%i==0:
    count +=1
if count==k:
  num=i
  break
  
print(num)

Fixed submission:
A, B, K = list(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 python submission (verdict: Runtime Error):
a,b,k=map(int,input().split())

count=0

for i in range(1,min(a,b)+1)[::-1]:
  if a%i==0 and b%i==0:
    count +=1
if count=k:
  num=i
  break
  
print(num)

Fixed submission:
A, B, K = list(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 python submission (verdict: Runtime Error):
a,b,k=map(int,input().split())

count=0

for i range(1,max(a,b)+1)[::-1]

if a%i==0 and b%i==0:
  count+=1
  if count==k:
    print(i)

Fixed submission:
A, B, K = list(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 python submission (verdict: Runtime Error):
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-1:
      num=i
      break
 
print(num)

Fixed submission:
A, B, K = list(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 python submission (verdict: Runtime Error):
S=input()

count=0

for i in S:
  if i=="1":
    count +=1

print(min(i,len(S)-count))

Fixed submission:
S=input()
 
count=0
 
for i in S:
  if i=="1":
    count +=1
 
print(min(count,len(S)-count)*2)
Buggy python submission (verdict: Runtime Error):
n,k = map(int, input(), split())

if n%k==0:
  print(0)
  
else:
  print(1)

Fixed submission:
n,k = map(int, input().split())

if n%k==0:
  print(str(0))

else:
  print(str(1))
Buggy python submission (verdict: Runtime Error):
n = int(input())

if n<1200:
  print("ABC")
  
elif 1200=<n<2800:
  print("ARC")
  
else:
  print("AGC")

Fixed submission:
n = int(input())

if n<1200:
  print("ABC")
  
elif 1200<=n<2800:
  print("ARC")
  
else:
  print("AGC")
Buggy python submission (verdict: Runtime Error):
N = int(input())

print(2*N if N%2==0 else n)

Fixed submission:
n = int(input())

print(2*n if n%2 else n)
Buggy python submission (verdict: Runtime Error):
L = input()

returnVal = (L/3)**3
print(returnVal)

Fixed submission:
L = float(input())

returnVal = (L/3)**3
print(returnVal)
Buggy python submission (verdict: Runtime Error):
n,x,y = map(int,input().split())
cnt_l = [0]*n
from collections import deque
# 幅優先探索
def bfs(start):  
  queue = deque()
  queue.append(start)
  step_counts = [-1]*(n+1)
  step_counts[start] = 0
  while(queue):
    i = queue.popleft()
    cnt = step_counts[i]
    # 隣のグラフを取得
    if(i==x):
      nex_l = (i-1,y,i+1)
      elif(i==y):
        nex_l = (i-1,x,i+1)
      else:
        nex_l = (i-1,i+1)

      cnt += 1
      for j in nex_l:
        # 端より先だと止める
        if(j < 1 or n < j):
          continue
          # 訪問済みだと止める
          if(step_counts[j]!=-1):
            continue
            queue.append(j)
            step_counts[j] = cnt
            cnt_l[cnt] += 1


for i in range(1,n+1):
  bfs(i)
 
for i in range(1,n):
  # (a,b),(b,a)のペアがあるため//2
  print(cnt_l[i]//2)


Fixed submission:
n,x,y = map(int,input().split())
cnt_l = [0]*n
from collections import deque
# 幅優先探索
def bfs(start):
    queue = deque()
    queue.append(start)
    step_counts = [-1]*(n+1)
    step_counts[start] = 0
    while(queue):
        i = queue.popleft()
        cnt = step_counts[i]
        # 隣のグラフを取得
        if(i==x):
            nex_l = (i-1,y,i+1)
        elif(i==y):
            nex_l = (i-1,x,i+1)
        else:
            nex_l = (i-1,i+1)

        cnt += 1
        for j in nex_l:
            # 端より先だと止める
            if(j < 1 or n < j):
                continue
            # 訪問済みだと止める
            if(step_counts[j]!=-1):
                continue
            queue.append(j)
            step_counts[j] = cnt
            cnt_l[cnt] += 1

for i in range(1,n+1):
    bfs(i)

for i in range(1,n):
    # (a,b),(b,a)のペアがあるため//2
    print(cnt_l[i]//2)