Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=['']*n
for i in range(n):
  s[i]=sorted(list(input()))
ans=0
for i in range(n):
  for j in range(i,n):
    if s[i]==s[j] and not i==j:
      ans+=1
print(ans)

Fixed submission:
n=int(input())
dict={}
ans=0
for i in range(n):
  s=''.join(sorted(input()))
  dict[s]=dict.get(s,-1)+1
  ans+=dict[s]
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter as C
n=int(input())
s=['']*n
for i in range(n):
  s[i]=C(sorted(list(input())))
ans=0
for i in range(n):
  for j in range(i,n):
    if s[i]==s[j] and not i==j:
      ans+=1
print(ans)

Fixed submission:
n=int(input())
dict={}
ans=0
for i in range(n):
  s=''.join(sorted(input()))
  dict[s]=dict.get(s,-1)+1
  ans+=dict[s]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
s=[1 if i=="R" else -1 for i in input()]
n=len(s)
k=10**100
a=[i+s[i] for i in range(n)]
while k:
  a=[a[i] for i in a]
  k >>= 1
print(*[a.count(i) for i in range(n)])

Fixed submission:
s=input()
ans=[0]*len(s)
cnt=1
for i in range(1,len(s)):
  if s[i]=='R':
    cnt+=1
  else:
    ans[i-1]+=(cnt+1)//2
    ans[i]+=cnt-(cnt+1)//2
    cnt=0
cnt=1
for i in range(len(s)-1)[::-1]:
  if s[i]=='L':
    cnt+=1
  else:
    ans[i+1]+=(cnt+1)//2
    ans[i]+=cnt-(cnt+1)//2
    cnt=0
print(' '.join(map(str,ans)))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[int(input()) for _ in range(n)]
for i in range(n):
  b=a[:]
  del b[i]
  print(max(b))

Fixed submission:
n=int(input())
a=[int(input()) for _ in range(n)]
b=sorted(a)
for i in a:
  print(b[-2] if i==b[-1] else b[-1])
Buggy python submission (verdict: Runtime Error):
n=int(input())
d=sorted(list(map(int,input().split())))
print(d[n//2]-d[N//2-1])

Fixed submission:
n=int(input())
d=sorted(list(map(int,input().split())))
print(d[n//2]-d[n//2-1])
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
c=[[1 for _ in range(n)] for _ in range(n)]
mod=10**9+7
for i in range(1,n):
  for j in range(1,i):
    c[i][j]=c[i-1][j]+c[i-1][j-1]
for i in range(1,k+1):
  print(c[n-k+1][i]*c[k-1][i-1]%mod)

Fixed submission:
n,k=map(int,input().split())
c=[[0]*(n+1) for _ in range(n+1)]
for i in range(n+1):
  c[i][0]=1
mod=10**9+7
for i in range(1,n+1):
  for j in range(1,i+1):
    c[i][j]=c[i-1][j]+c[i-1][j-1]
for i in range(1,k+1):
  print(c[n-k+1][i]*c[k-1][i-1]%mod)
Buggy python submission (verdict: Runtime Error):
n,l=map(int,input().split())
print(((l+n-1)*(l+n)-l*(l+1))//2-l if l>=0 else (((l+n-1)*(l+n)-l*(l+1))//2 if l<0 and l+n>0 ((l+n-1)*(l+n)-l*(l+1))//2-(l+n-1)))

Fixed submission:
n,l=map(int,input().split())
m=[l+i for i in range(n)]
s=sum(m)
t=101
d=0
for i in range(n):
  if t>abs(m[i]):
    t=abs(m[i])
    d=m[i]
print(s-d)
Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
l=list(map(int,input().split()))
d=0
i=0
while(True):
  d+=l[i]
  i+=1
  if(!(d<x or i<=n)):
    break
print(i)

Fixed submission:
n,x=map(int,input().split())
l=list(map(int,input().split()))
d=0
i=1
while i<=n:
  d+=l[i-1]
  if x<d:
    break
  i+=1
print(i)

Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
l=list(map(int,input().split()))
d=0
i=0
while(True):
  d+=l[i-1]
  i+=1
  if(!(d<x or i<=n)):
    break
print(i)

Fixed submission:
n,x=map(int,input().split())
l=list(map(int,input().split()))
d=0
i=1
while i<=n:
  d+=l[i-1]
  if x<d:
    break
  i+=1
print(i)

Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
l=list(map(int,input().split()))
d=0
i=0
while(d<=x and i<=n):
  d+=l[i]
  i+=1;
print(i)

Fixed submission:
n,x=map(int,input().split())
l=list(map(int,input().split()))
d=0
i=1
while i<=n:
  d+=l[i-1]
  if x<d:
    break
  i+=1
print(i)

Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
l=list(map(int,input().split()))
d=0
i=0
while(d<=x):
  d+=l[i]
  i+=1;
print(i)

Fixed submission:
n,x=map(int,input().split())
l=list(map(int,input().split()))
d=0
i=1
while i<=n:
  d+=l[i-1]
  if x<d:
    break
  i+=1
print(i)
Buggy python submission (verdict: Runtime Error):
from collections import Counter
n=int(input())
xy=[tuple(map(int,input().split())) for _ in range(n)]
xy.sort()
l=[]
for i in range(n-1):
  for j in range(i+1,n):
    l.append((xy[j][0]-xy[i][0],xy[j][1]-xy[i][1]))
print(n-Counter(l).most_common()[0][1])

Fixed submission:
from collections import Counter
n=int(input())
if n==1:
  print(1)
  exit()
xy=[tuple(map(int,input().split())) for _ in range(n)]
xy.sort()
l=[]
for i in range(n-1):
  for j in range(i+1,n):
    l.append((xy[j][0]-xy[i][0],xy[j][1]-xy[i][1]))
print(n-Counter(l).most_common()[0][1])
Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
a=[int(input()) for _ in range(m)]
b=[(True if i in a else False) for i in range(n+1)]
fib=[0]*(n+1)
fib[0]=1
fib[1]=[1,0][b[1]]
for i in range(2,n+1):
  fib[i]=[fib[i-1]+fib[i-2],0][b[i]]
  fib[i]%=10**9+7
print(fib[n])

Fixed submission:
n,m=map(int,input().split())
mod=10**9+7
a=[False]*(n+1)
for i in range(m):
  a[int(input())]=True
fib=[0]*(n+1)
fib[0]=1
fib[1]=[1,0][a[1]]
for i in range(2,n+1):
  if a[i]:
    fib[i]=0
  else:
    fib[i]=(fib[i-1]+fib[i-2])%mod
print(fib[n])

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
a=[int(input()) for _ in range(m)]
fib=[0]*(n+2)
fib[0]=1
fib[1]=[1,0][a.count(1)]
for i in range(2,n+1):
  fib[i]=[fib[i-1]+fib[i-2],0][a.count(i)]
  fib[i]%=10**9+7
print(fib[n])

Fixed submission:
n,m=map(int,input().split())
mod=10**9+7
a=[False]*(n+1)
for i in range(m):
  a[int(input())]=True
fib=[0]*(n+1)
fib[0]=1
fib[1]=[1,0][a[1]]
for i in range(2,n+1):
  if a[i]:
    fib[i]=0
  else:
    fib[i]=(fib[i-1]+fib[i-2])%mod
print(fib[n])
Buggy python submission (verdict: Runtime Error):
x=[int(input()) for i in range(5)]
print("Yay!" if max(x)-min(x)>=k else ":(")

Fixed submission:
x=[int(input()) for i in range(5)]
k=int(input())
print("Yay!" if max(x)-min(x)<=k else ":(")

Buggy python submission (verdict: Runtime Error):
x=[input() for i in range(5)]
print("Yay!" if max(x)-min(x)>=k else ":(")

Fixed submission:
x=[int(input()) for i in range(5)]
k=int(input())
print("Yay!" if max(x)-min(x)<=k else ":(")
Buggy python submission (verdict: Time Limit Exceeded):
N,Q=map(int, input().split())
S=list(input())
A = []
for i in range(Q):
  A.append(list(map(int, input().split())))
for i in range(Q):
  print(("".join(S[A[i][0]-1:A[i][1]])).count("AC"))

Fixed submission:
N,Q=map(int,input().split())
S=input()
a=[0]*N
for i in range(N-1):
  a[i+1]=a[i]+(1 if S[i:i+2]=="AC" else 0)
for i in range(Q):
  l,r=map(int,input().split())
  print(a[r-1]-a[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
N,Q=map(int, input().split())
S=list(input())
A = []
for i in range(Q):
  A.append(list(map(int, input().split())))
flag=0
B = []
for i in range(N):
  if S[i]=="A":
    flag=i
    continue
  if S[i]=="C" and flag==i-1:
    B.append(i)
    flag=False
for i in range(Q):
  print(sum(A[i][0]<=x<A[i][1] for x in B))

Fixed submission:
N,Q=map(int,input().split())
S=input()
a=[0]*N
for i in range(N-1):
  a[i+1]=a[i]+(1 if S[i:i+2]=="AC" else 0)
for i in range(Q):
  l,r=map(int,input().split())
  print(a[r-1]-a[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
N,Q=map(int, input().split())
S=list(input())
A = []
for i in range(Q):
  A.append(list(map(int, input().split())))
for i in range(Q):
  count=0
  ent=False
  L=S[A[i][0]-1:A[i][1]]
  for j in range(len(L)):
    if L[j]=="A":
      ent=True
    if L[j]=="C" and ent==True:
      count+=1
      ent=False
  print(count)

Fixed submission:
N,Q=map(int,input().split())
S=input()
a=[0]*N
for i in range(N-1):
  a[i+1]=a[i]+(1 if S[i:i+2]=="AC" else 0)
for i in range(Q):
  l,r=map(int,input().split())
  print(a[r-1]-a[l-1])
Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int, input().split())
AB=[]
for i in range(N):
  AB.append(list(map(int,input().split())))
AB.sort()
count=0
summary=0
for i in range(N):
  for j in range(AB[i][1]):
    summary+=AB[i][0]
    count+=1
    if count==M:
      print(summary)
      break

Fixed submission:
N,M=map(int, input().split())
AB=[]
for i in range(N):
  AB.append(list(map(int,input().split())))
AB.sort()
count=0
summary=0
for i in range(N):
  for j in range(AB[i][1]):
    summary+=AB[i][0]
    count+=1
    if count==M:
      print(summary)
      break
  else:
    continue
  break
Buggy python submission (verdict: Runtime Error):
a,b=map(iunt,input().split())
print(a+b if b%a==0 else b-a)

Fixed submission:
a,b=map(int,input().split())
print(a+b if b%a==0 else b-a)
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))
m=l.pop(max(l))
print("Yes" if m>sum(l) else "No")

Fixed submission:
n=int(input())
l=sorted(list(map(int,input().split())))
m=l.pop(-1)
print("Yes" if m<sum(l) else "No")
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
x=sorted([int(i) for i in input().split()])
if n>=m:
  print(0)
else:
  l=sorted([x(i+1)-x(i) for i in range(m-1)])
  print(sum(l[:m-n]))

Fixed submission:
n,m=map(int,input().split())
x=sorted([int(i) for i in input().split()])
if n>=m:
  print(0)
else:
  l=sorted([x[i+1]-x[i] for i in range(m-1)])
  print(sum(l[:m-n]))
Buggy python submission (verdict: Runtime Error):
n=int(input())
h=[int(i) for i in input().split()]
inf=10**10
dp=[inf]*n
def rec(i):
  if dp[i]<inf:
    return dp[i]
  elif i==0:
    return 0
  res=inf
  res=min(inf,rec(i-1)+abs(h[i]-h[i-1]))
  if i>1:
    res=min(res,rec(i-2)+abs(h[i]-h[i-2]))
  dp[i]=res
  return res
print(rec(n-1))


Fixed submission:
n=int(input())
h=[int(i) for i in input().split()]
dp=[0]*n
dp[1]=abs(h[1]-h[0])
for i in range(1,n-1):
  dp[i+1]+=min(dp[i]+abs(h[i+1]-h[i]),dp[i-1]+abs(h[i+1]-h[i-1]))
print(dp[n-1])

Buggy python submission (verdict: Runtime Error):
n=int(input())
h=[int(i) for i in input().split()]
inf=10**10
dp=[inf]*n
def rec(i):
  if dp[i]<inf:
    return dp[i]
  elif i==0:
    return 0
  elif i==1:
    return h[1]-h[0]
  res=min(inf,rec(i-1)+abs(h[i]-h[i-1]),rec(i-2)+abs(h[i]-h[i-2]))
  dp[i]=res
  return res
print(rec(n-1))

Fixed submission:
n=int(input())
h=[int(i) for i in input().split()]
dp=[0]*n
dp[1]=abs(h[1]-h[0])
for i in range(1,n-1):
  dp[i+1]+=min(dp[i]+abs(h[i+1]-h[i]),dp[i-1]+abs(h[i+1]-h[i-1]))
print(dp[n-1])

Buggy python submission (verdict: Runtime Error):
n=int(input())
h=[int(i) for i in input().split()]
memo=[-1]*n
def rec(n):
    if n==1:
        return 0
    elif n==2:
        return abs(h[1]-h[0])
    else:
      if memo[n-1]!=-1:
        return memo[n-1]
      else:
        return min(rec(n-1)+abs(h[n-1]-h[n-2]),rec(n-2)+abs(h[n-1]-h[n-3]))
print(rec(n))

Fixed submission:
n=int(input())
h=[int(i) for i in input().split()]
dp=[0]*n
dp[1]=abs(h[1]-h[0])
for i in range(1,n-1):
  dp[i+1]+=min(dp[i]+abs(h[i+1]-h[i]),dp[i-1]+abs(h[i+1]-h[i-1]))
print(dp[n-1])

Buggy python submission (verdict: Runtime Error):
N = int(input())
h = [int(i) for i in input().split()]
cost = [-1]*N
def jump_min(n):
    if n == 1:
        v = 0
    elif n == 2:
        v = abs(h[1]-h[0])
    else:
        x = jump_min(n-2)+abs(h[n-1]-h[n-3])
        y = jump_min(n-1)+abs(h[n-1]-h[n-2])
        v = min(x,y)
    return v
print(jump_min(N))


Fixed submission:
n=int(input())
h=[int(i) for i in input().split()]
dp=[0]*n
dp[1]=abs(h[1]-h[0])
for i in range(1,n-1):
  dp[i+1]+=min(dp[i]+abs(h[i+1]-h[i]),dp[i-1]+abs(h[i+1]-h[i-1]))
print(dp[n-1])
Buggy python submission (verdict: Time Limit Exceeded):
N,W=map(int,input().split())
dp=[[0]*(W+1) for _ in range(N)]
for i in range(N):
  w,v=map(int,input().split())
  for j in range(W+1):
    dp[i][j]=max(dp[i-1][j-w]+v if j>=w else 0,dp[i-1][j])
print(dp[-1][-1])

Fixed submission:
N,W=map(int,input().split())
dp=[[0]*(W+1) for _ in range(N)]
for i in range(N):
  w,v=map(int,input().split())
  for j in range(W+1):
    dp[i][j]=max(dp[i-1][j-w]+v if j>=w else 0,dp[i-1][j])
print(dp[-1][-1])
Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
n,m=map(int,input().split())
s=input()
t=input()
l=n*m//gcd(n,m)
for i in range(l):
  if ((i-1)*n)%l==0 and ((i-1)*m)%l==0:
    if not s[((i-1)*n)//l]==t[((i-1)*m)//l]:
      print(-1)
      exit()
print(l)

Fixed submission:
from fractions import gcd
n,m=map(int,input().split())
s=input()
t=input()
g=gcd(n,m)
l=n*m//g
for i in range(n):
  if i%(n//g)==0 and not s[i]==t[i*m//n]:
    print(-1)
    exit()
print(l)
Buggy python submission (verdict: Runtime Error):
print("Hello World!" if input()==1 else int(input())+int(input()))

Fixed submission:
print("Hello World" if input()=='1' else int(input())+int(input()))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
x,y,h=[0]*n,[0]*n,[0]*n
for i in range(n):
  x[i],y[i],h[i]=map(int,input().split())
mn_h=min(h)
mx_h=max(h)
for H in range(mn_h-210,mx_h+210):
  for C_x in range(101):
    for C_y in range(101):
      for i in range(n):
        if not h[i]==max(H-abs(x[i]-C_x)-abs(y[i]-C_y),0):
          break
      else:
        print(C_x,C_y,H)
        exit()

Fixed submission:
n=int(input())
x,y,h=[0]*n,[0]*n,[0]*n
for i in range(n):
  x[i],y[i],h[i]=map(int,input().split())
mn_h=min(h)
mx_h=max(h)
for C_x in range(101):
  for C_y in range(101):
    for i in range(n):
      H=h[i]+abs(x[i]-C_x)+abs(y[i]-C_y)
      if H>0:
        if all(max(H-abs(x[j]-C_x)-abs(y[j]-C_y),0)==h[j] for j in range(n)):
          print(C_x,C_y,H)
          exit()

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
x,y,h=[0]*n,[0]*n,[0]*n
for i in range(n):
  x[i],y[i],h[i]=map(int,input().split())
mn_h=min(h)
mx_h=max(h)
for H in range(mn_h-210,mx_h+210):
  for C_x in range(101):
    for C_y in range(101):
      for i in range(n):
        if not h[i]==max(H-abs(x[i]-C_x)-abs(y[i]-C_y),0):
          break
      else:
        print(C_x,C_y,H)

Fixed submission:
n=int(input())
x,y,h=[0]*n,[0]*n,[0]*n
for i in range(n):
  x[i],y[i],h[i]=map(int,input().split())
mn_h=min(h)
mx_h=max(h)
for C_x in range(101):
  for C_y in range(101):
    for i in range(n):
      H=h[i]+abs(x[i]-C_x)+abs(y[i]-C_y)
      if H>0:
        if all(max(H-abs(x[j]-C_x)-abs(y[j]-C_y),0)==h[j] for j in range(n)):
          print(C_x,C_y,H)
          exit()
Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
n,m=map(int,input().split())
ans=1
for i in range(m//n+1)[::-1]:
  if gcd(m-i*(n-1),i)==i and ans==1:
    ans=i
    break
print(ans)

Fixed submission:
n,m=map(int,input().split())
def divisors(n):
  div=[]
  for i in range(1,int(n**0.5)+1):
    if n%i==0:
      div.append(i)
      if not i==n//i:
        div.append(n//i)
  div=sorted(div)[::-1]
  return div
ans=1
for i in divisors(m):
  if m-i*(n-1)>0:
    ans=i
    break
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
n,m=map(int,input().split())
ans=1
for i in range(m//n+1):
  if gcd(m-i*(n-1),i)==i:
    ans=i
print(ans)

Fixed submission:
n,m=map(int,input().split())
def divisors(n):
  div=[]
  for i in range(1,int(n**0.5)+1):
    if n%i==0:
      div.append(i)
      if not i==n//i:
        div.append(n//i)
  div=sorted(div)[::-1]
  return div
ans=1
for i in divisors(m):
  if m-i*(n-1)>0:
    ans=i
    break
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
n,m=map(int,input().split())
ans=1
for i in range(m//n+1):
  if gcd(m-i*(n-1),i)==i:
    ans=i
print(ans)

Fixed submission:
n,m=map(int,input().split())
def divisors(n):
  div=[]
  for i in range(1,int(n**0.5)+1):
    if n%i==0:
      div.append(i)
      if not i==n//i:
        div.append(n//i)
  div=sorted(div)[::-1]
  return div
ans=1
for i in divisors(m):
  if m-i*(n-1)>0:
    ans=i
    break
print(ans)
Buggy python submission (verdict: Runtime Error):
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
flag=0
for i in range(N):
  if x[i]=>Y:
    flag+=1
for i in range(M):
  if y[i]=<X:
    flag+=1
if X>Y:
  flag+=1
if flag>0:
  print("War")
else:
  if min(y)>max(x):
    print("No War")
  else:
    print("War")

Fixed submission:
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
flag=0
for i in range(N):
  if x[i]>=Y:
    flag+=1
for i in range(M):
  if y[i]<=X:
    flag+=1
if X>Y:
  flag+=1
if flag>0:
  print("War")
else:
  if min(y)>max(x):
    print("No War")
  else:
    print("War")
Buggy python submission (verdict: Runtime Error):
N,X=map(int,input().split())
inputcities=list(map(int, input().split()))
cities=list(set([abs(inputcities[i]-X) for i in range(N)]))
N=len(cities)
count=0
flag=0
minimum=min(cities)
for j in range(minimum+1)[::-1]:
  for i in range(N):
    if cities[i]%j==0:
      count+=1
    else:
      count=0
      break
    if count==N:
      print(j)
      flag=1
      break
  if flag==1:
    break

Fixed submission:
A,B=map(int,input().split())
if A*B*1%2==1 or A*B*2%2==1 or A*B*3%2==1:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
A,B=map(int,input.split())
if A*B*1%2==1 or A*B*2%2==1 or A*B*3%2==1:
  print("Yes")
else:
  print("No")

Fixed submission:
A,B=map(int,input().split())
if A*B*1%2==1 or A*B*2%2==1 or A*B*3%2==1:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
K=int(input())
if K%2==0:
  print((K/2)^2)
else:
  print(((K+1)/2)*((K-1)/2))

Fixed submission:
K=int(input())
if K%2==0:
  print(int((K/2)*(K/2)))
else:
  print(int(((K+1)/2)*((K-1)/2)))
Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
count=0
for a in range(1,N+1):
  for b in range(1,N+1):
    for c in range(1,N+1):
      if 2*(a+b+c)%K==0:
        if (a+b)%K==0 and (b+c)%K==0 and (c+a)%K==0:
          count+=1
print(count)


Fixed submission:
n,k=map(int,input().split())
ans=0
if k%2==0:
  ans+=(n//k+(1 if n%k>=k//2 else 0))**3
ans+=(n//k)**3
print(ans)
Buggy python submission (verdict: Runtime Error):
print(int(input())-int(input())+1)

Fixed submission:
a,b=map(int,input().split());print(a-b+1)
Buggy python submission (verdict: Runtime Error):
N=input()
div=0
A=0
B=0
count=0
answer=0
for i in range(1,N+1,2):
  div=0
  count=0
  while True:
    div+=1
    if i%div==0:
      A=div
      B=N/siv
      count+=1
    if B=count:
      if A<B and count==4:
        answer+=1  
      break
print(answer)

Fixed submission:
N=int(input())
div=0
A=0
B=N
count=0
answer=0
for i in range(1,N+1,2):
  div=0
  count=0
  while True:
    div+=1
    if i%div==0:
      A=div
      B=i/div
      if A<B:
        count+=1
    if A>=B:
      if count==4:
        answer+=1  
      break
print(answer)
Buggy python submission (verdict: Runtime Error):
N,K=input()
if N%K==0:
  print("0")
else:
  print("1")

Fixed submission:
N, K = map(int, input().split())
if N%K==0:
  print(0)
else:
  print(1)
Buggy python submission (verdict: Runtime Error):
N=int(input())
L=[]
M=""
while N!=0:
  M=int((-1)*(N%(-2)))
  if N<0:
    N=int((N-1)/(-2))
  else:
    N=int(N/(-2))
  L.insert(0,str(M))
if N=0:
  print(0)
else:
  print("".join(L))

Fixed submission:
N=int(input())
L=[]
M=""
while N!=0:
  M=int((-1)*(N%(-2)))
  if N<0:
    N=int((N-1)/(-2))
  else:
    N=int(N/(-2))
  L.insert(0,str(M))
if len(L)==0:
  L=["0"]
print("".join(L))
Buggy python submission (verdict: Runtime Error):
R=input()
if R<1200:
  print("ABC")
elif R>=1200 and R<2800:
  print("ARC")
elif R>=2800:
  print("AGC")

Fixed submission:
R=int(input())
if R<1200:
  print("ABC")
elif R>=1200 and R<2800:
  print("ARC")
elif R>=2800:
  print("AGC")
Buggy python submission (verdict: Runtime Error):
S=list(input())
flag=0
Ccount=0
Lcount=0
Cnumber=-1
if S[0]=="A":
  flag+=1
  del S[0]
if S.count("C")==1:
  flag+=1
  del S[Cnumber]
N=len(S)
if S[0:].islower():
  flag+=1
if flag==3:
  print("AC")
else:
  print("WA")

Fixed submission:
S=list(input())
flag=0
Ccount=0
Cnumber=0
if S[0]=="A":
  flag+=1
if S[2:-1].count("C")==1:
  flag+=1
  del S[0]
  S.remove("C")
if str(S).islower():
  flag+=1
if flag==3:
  print("AC")
else:
  print("WA")

Buggy python submission (verdict: Runtime Error):
S=list(input())
flag=0
Ccount=0
Lcount=0
if S[0]=="A":
  flag+=1
  del S[0]
if flag!=1:
  flag=-100
N=len(S)
for i in range(1,N-1):
  if S[i]=="C":
    Ccount+=1
    del S[i]
if Ccount==1:
  flag+=1
if flag!=2:
  flag=-100
N=len(S)
for i in range(N):
  if S[i].islower():
    Lcount+=1
if Lcount==N:
  flag+=1
if flag==3:
  print("AC")
else:
  print("WA")

Fixed submission:
S=list(input())
flag=0
Ccount=0
Cnumber=0
if S[0]=="A":
  flag+=1
if S[2:-1].count("C")==1:
  flag+=1
  del S[0]
  S.remove("C")
if str(S).islower():
  flag+=1
if flag==3:
  print("AC")
else:
  print("WA")

Buggy python submission (verdict: Runtime Error):
S=list(input())
flag=0
Ccount=0
Lcount=0
if S[0]=="A":
  flag+=1
  del S[0]
N=len(S)
for i in range(1,N-1):
  if S[i]=="C":
    Ccount+=1
    del S[i]
if Ccount==1:
  flag+=1
M=len(S)
for i in range(M):
  if S[i].islower():
    Lcount+=1
if Lcount==M:
  flag+=1
if flag==3:
  print("AC")
else:
  print("WA")

Fixed submission:
S=list(input())
flag=0
Ccount=0
Cnumber=0
if S[0]=="A":
  flag+=1
if S[2:-1].count("C")==1:
  flag+=1
  del S[0]
  S.remove("C")
if str(S).islower():
  flag+=1
if flag==3:
  print("AC")
else:
  print("WA")

Buggy python submission (verdict: Runtime Error):
S=list(input())
flag=0
Ccount=0
Lcount=0
if S[0]=="A":
  flag+=1
  del S[0]
N=len(S)
for i in range(1,N-1):
  if S[i]=="C":
    Ccount+=1
    del S[i]
if Ccount==1:
  flag+=1
M=len(S)
for i in range(M):
  if S[i].islower():
    Lcount+=1
if Lcount==M:
  flag+=1
if flag==3:
  print("AC")
else:
  print("WA")
    



Fixed submission:
S=list(input())
flag=0
Ccount=0
Cnumber=0
if S[0]=="A":
  flag+=1
if S[2:-1].count("C")==1:
  flag+=1
  del S[0]
  S.remove("C")
if str(S).islower():
  flag+=1
if flag==3:
  print("AC")
else:
  print("WA")
Buggy python submission (verdict: Runtime Error):
L = list(map(int, raw_input().split()))
MAX=max(L)
MIN=min(L)
print(MAX-MIN)

Fixed submission:
L = list(map(int, input().split()))
MAX=max(L)
MIN=min(L)
print(MAX-MIN)
Buggy python submission (verdict: Runtime Error):
print("AB"+["D","C"][n<1000])

Fixed submission:
print("AB"+["D","C"][int(input())<1000])
Buggy python submission (verdict: Runtime Error):
x=int(input())
ans=0
for b in range(2,x):
  for p in range(2,x):
    if x-b**p>=0:
      ans=max(ans,b**p)
    else:
      break
print(ans)


Fixed submission:
a,b,c,d=map(int,input().split())
print("Yes" if ((abs(a-b)<=d and abs(b-c)<=d) or abs(a-c)<=d) else "No")

Buggy python submission (verdict: Runtime Error):
x=int(input())
ans=0
for b in range(2,11):
  for p in range(2,x):
    if x-b**p>=0:
      ans=max(ans,b**p)
    else:
      break
print(ans)

Fixed submission:
a,b,c,d=map(int,input().split())
print("Yes" if ((abs(a-b)<=d and abs(b-c)<=d) or abs(a-c)<=d) else "No")
Buggy python submission (verdict: Runtime Error):
x=int(input())
ans=0
for i in range(2,11):
  for j in range(x):
    if x-j**i>0 and j**i>ans:
      tmp=j**i
    else:
      break
  ans=[tmp,ans][tmp<ans]
print(ans)

Fixed submission:
x=int(input())
ans=1
for b in range(1,x):
  for p in range(2,x):
    if x-b**p>=0:
      ans=max(ans,b**p)
    else:
      break
print(ans)
Buggy python submission (verdict: Runtime Error):
s=input()
print(700+100*((s[0]==o)+(s[1]==o)+(s[2]==o)))

Fixed submission:
s=input()
print(700+100*((s[0]=='o')+(s[1]=='o')+(s[2]=='o')))
Buggy python submission (verdict: Runtime Error):
print((int(input())+int(input())+0.99999999999)//2)

Fixed submission:
a,b=map(int,input().split())
print(int((a+b)/2+0.99999))
Buggy python submission (verdict: Runtime Error):
a,b,c=int(input())
print(a+b+c)

Fixed submission:
a,b,c=map(int,input())
print(a+b+c)

Buggy python submission (verdict: Runtime Error):
S=list(input())
print(len([i for i in S if S[i]=='1']))

Fixed submission:
a,b,c=map(int,input())
print(a+b+c)
Buggy python submission (verdict: Runtime Error):
a,b=map(ord,input().split())
print(['<' if a<b else '>','='][a==b]

Fixed submission:
a,b=map(ord,input().split())
print(['<' if a<b else '>','='][a==b])