Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
x=9999999999999999
s=[list(map(int,input().split())) for i in range(m)]
s=sorted(s)
for i in range(m):
  if s[i][0]==1 and s[i][1]==0:
    x=-1

for i in range(m):
  for j in range(m):
    if s[i][0]==s[j][0] and s[i][1]!=s[j][1]:
      x=-1

a=[0]*n
ans=0
for i in range(n):
  a[s[i][0]-1]=s[i][1]

if a[0]==0:
  a[0]=1

for i in range(m):
  ans+=a[i]*10**(n-i-1)


print(min(x,ans))

Fixed submission:
n,m=map(int,input().split())
x=99999
s=[list(map(int,input().split())) for i in range(m)]
s=sorted(s)
for i in range(m):
    if s[i][0]==1 and s[i][1]==0 and n!=1:
        x=-1

for i in range(m):
    for j in range(m):
        if s[i][0]==s[j][0] and s[i][1]!=s[j][1]:
            x=-1

a=[0]*n
ans=0
for i in range(m):
    a[s[i][0]-1]=s[i][1]

if a[0]==0 and n!=1:
    a[0]=1

for i in range(n):
    ans+=a[i]*(10**(n-i-1))


print(min(x,ans))

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
x=9999999999999999
s=[list(map(int,input().split())) for i in range(m)]
s=sorted(s)
for i in range(m):
  if s[i][0]==1 and s[i][1]==0:
    x=-1

for i in range(m):
  for j in range(m):
    if s[i][0]==s[j][0] and s[i][1]!=s[j][1]:
      x=-1

a=[0]*n
ans=0
for i in range(m):
  a[s[i][0]-1]=s[i][1]

if a[0]==0:
  a[0]=1

for i in range(m):
  ans+=a[i]*10**(n-i-1)


print(min(x,ans))

Fixed submission:
n,m=map(int,input().split())
x=99999
s=[list(map(int,input().split())) for i in range(m)]
s=sorted(s)
for i in range(m):
    if s[i][0]==1 and s[i][1]==0 and n!=1:
        x=-1

for i in range(m):
    for j in range(m):
        if s[i][0]==s[j][0] and s[i][1]!=s[j][1]:
            x=-1

a=[0]*n
ans=0
for i in range(m):
    a[s[i][0]-1]=s[i][1]

if a[0]==0 and n!=1:
    a[0]=1

for i in range(n):
    ans+=a[i]*(10**(n-i-1))


print(min(x,ans))

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
x=0
s=[list(map(int,input().split())) for i in range(m)]
s=sorted(s)
for i in range(m):
  if s[i][0]==1 and s[i][1]==0:
    x=-1

for i in range(m):
  for j in range(m):
    if s[i][0]==s[j][0] and s[i][1]!=s[j][1]:
      x=-1

a=[0]*n
for i in range(m):
  a[s[i][0]]=s[i][1]

for i in range(m):
  ans=a[i]*10**(n-i-1)
if a[0]==0:
  ans+=100
print(x,ans)

Fixed submission:
n,m=map(int,input().split())
x=99999
s=[list(map(int,input().split())) for i in range(m)]
s=sorted(s)
for i in range(m):
    if s[i][0]==1 and s[i][1]==0 and n!=1:
        x=-1

for i in range(m):
    for j in range(m):
        if s[i][0]==s[j][0] and s[i][1]!=s[j][1]:
            x=-1

a=[0]*n
ans=0
for i in range(m):
    a[s[i][0]-1]=s[i][1]

if a[0]==0 and n!=1:
    a[0]=1

for i in range(n):
    ans+=a[i]*(10**(n-i-1))


print(min(x,ans))
Buggy python submission (verdict: Runtime Error):
import math
n,a,b=map(int,input().split())
na=1
m=7+10**9
def gyakugen(a,b):
    r=[1,0,a]
    w=[0,1,b]
    while(w[2]!=1):
        q=r[2]//w[2]
        r2=w
        w2=[r[0]-q*w[0],r[i]-q*w[i],r[2]-q*w[2]]
        r=r2
        w=w2
    return (b+w[0]%b)%b
ans=1
for i in range(n):
    ans*=2
    if ans>=m:
        ans%=m

for i in range(1,n+1):
    na=na*i%m
nb=na
for i in range(1,n-a+1):
    na=na*gyakugen(i,m)%m
for i in range(1,a+1):
    na=na*gyakugen(i,m)%m
for i in range(1,n-b+1):
    nb=nb*gyakugen(i,m)%m
for i in range(1,b+1):
    nb=nb*gyakugen(i,m)%m    
ans=ans-na-nb-1
ans%=m
print(ans)

Fixed submission:
n,a,b=map(int,input().split())
m=10**9+7

#(a*x)をmで割った余りが1になるようなxを求める
#aで割ったときの余りはa^(-1)をかけた余りと同じ
#逆元a^(-1)を求める
#aとmが互いに素であることが条件

def gyakugen( a, m ):
  b = m
  x, y = 1, 0
  while b>0:
    q = a // b
    a, b = b, a-q*b
    x, y = y, x-q*y
  return x if x>0 else x+m

#nPrをmで割った余りを求める(ただしn<m、mは素数)
import sys
sys.setrecursionlimit(10**9)#再帰の回数の上限を設定

def perm_remainder(n,r,m):
    if r>=1:
        return (perm_remainder(n-1,r-1,m)*n)%m
    else:
        return 1

#nCrをmで割った余りを求める(ただしn<m,mは素数)

def comb_remainder(n,r,m):
    r=min(r,n-r)
    return (perm_remainder(n,r,m)*gyakugen(perm_remainder(r,r,m),m))%m

#(a**n)を素数mで割った余りを求める
#当然aはmで割り切れない整数

def power_remainder(a,x,m):
    a=a%m
    bi=str(format(x,"b"))#2進表現に
    res=1
    for i in range(len(bi)):
        res=(res*res) %m
        if bi[i]=="1":
            res=(res*a) %m
    return res

#2^n-nCa-nCb-1を計算
print((power_remainder(2,n,m)-1-comb_remainder(n,a,m)-comb_remainder(n,b,m))%m)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[]
m=[]
b=[]
for i in range(n):
  a.append(input())
for i in range(n):
  b.append(a.count(a[i]))
kaisu=max(b)
for i in range(n):
  if kaisu==b[i]:
    m.append(a[i])
m=sorted(list(set(m)))
n=len(m)
for i in range(n):
  print(m[i])

Fixed submission:
n=int(input())
s=[input() for i in range(n)]
s=sorted(s)
poll=[s[0]]
counta=[1]
kind=0
for i in range(1,n):
  if s[i]==s[i-1]:
    counta[kind]+=1
  else:
    kind+=1
    poll.append(s[i])
    counta.append(1)
m=max(counta)
for i in range(kind+1):
  if counta[i]==m:
    print(poll[i])

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[]
m=[]
b=[]
for i in range(n):
  a.append(input())
kaisu=1
for i in range(n):
  b.append(a.count(a[i]))
for i in range(n):
  if kaisu==b[i]:
    m.append(a[i])
  elif kaisu<b[i]:
    m=[a[i]]
    kaisu=b[i]
m=sorted(list(set(m)))
n=len(m)
for i in range(n):
  print(m[i])

Fixed submission:
n=int(input())
s=[input() for i in range(n)]
s=sorted(s)
poll=[s[0]]
counta=[1]
kind=0
for i in range(1,n):
  if s[i]==s[i-1]:
    counta[kind]+=1
  else:
    kind+=1
    poll.append(s[i])
    counta.append(1)
m=max(counta)
for i in range(kind+1):
  if counta[i]==m:
    print(poll[i])

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[]
m=[]
for i in range(n):
  a.append(input())
kaisu=1
for i in range(n):
  if kaisu==a.count(a[i]):
    m.append(a[i])
  elif kaisu<a.count(a[i]):
    m=[a[i]]
    kaisu=a.count(a[i])
m=sorted(list(set(m)))
n=len(m)
for i in range(n):
  print(m[i])

Fixed submission:
n=int(input())
s=[input() for i in range(n)]
s=sorted(s)
poll=[s[0]]
counta=[1]
kind=0
for i in range(1,n):
  if s[i]==s[i-1]:
    counta[kind]+=1
  else:
    kind+=1
    poll.append(s[i])
    counta.append(1)
m=max(counta)
for i in range(kind+1):
  if counta[i]==m:
    print(poll[i])
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=sorted(list(map(int,input().split())))
ans='YES'
for i in range(n):
  if a[i]==a[i+1]:
    ans='NO'
  if ans=='NO':
    break
print(ans)

Fixed submission:
n=int(input())
a=sorted(list(map(int,input().split())))
ans='YES'
for i in range(n-1):
  if a[i]==a[i+1]:
    ans='NO'
  if ans=='NO':
    break
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
ans='YES'
for i in range(min(a),1+max(a)):
  if a.count(i)>=2:
    ans='NO'
  if ans=='NO':
    break
print(ans)

Fixed submission:
n=int(input())
a=sorted(list(map(int,input().split())))
ans='YES'
for i in range(n-1):
  if a[i]==a[i+1]:
    ans='NO'
  if ans=='NO':
    break
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
ans='YES'
for i in range(n):
  for j in range(i+1,n):
    if a[i]==a[j]:
      ans='NO'
      break
  if ans=='NO':
    break
print(ans)

Fixed submission:
n=int(input())
a=sorted(list(map(int,input().split())))
ans='YES'
for i in range(n-1):
  if a[i]==a[i+1]:
    ans='NO'
  if ans=='NO':
    break
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
p=list(map(int,input().split()))
ans=0
m=n
for i in range(1,n+1):
  k=p.index(i)
  if m>k:
    m=k
    ans+=1


print(ans)

Fixed submission:
n=int(input())
p=list(map(int,input().split()))
ans = 0
mi = p[0]
 
for i in range(n):
    if p[i] <= mi:
        ans += 1
        mi = p[i]
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
p=list(map(int,input().split()))
ans=1
for i in range(1,n):
  if p[i]<min(p[0:i]):
    ans+=1

print(ans)

Fixed submission:
n=int(input())
p=list(map(int,input().split()))
ans = 0
mi = p[0]
 
for i in range(n):
    if p[i] <= mi:
        ans += 1
        mi = p[i]
    
print(ans)
Buggy python submission (verdict: Runtime Error):
print chr(ord(input()) + 1)

Fixed submission:
c = input()
print(chr(ord(c) + 1))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
x=1
for i in range(n):
  if a[0]==x:
    x+=1
  a.pop(0)

if x==1:
  ans=-1
else:
  ans=n-x+1

print(ans)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
x=1
for i in range(n):
  if a[i]==x:
    x+=1

if x==1:
  ans=-1
else:
  ans=n-x+1

print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()

t=str()

for i in s:
    x = chr(ord(i) + n)
    
    if ord(t) > ord('Z'):
        x = chr(ord(x) - ord('Z') + ord('A')-1)
    
    ss += x

print(t)


Fixed submission:
n = int(input())
s = input()

ss=str()

for i in s:
    t = chr(ord(i) + n)
    
    if ord(t) > ord('Z'):
        t = chr(ord(t) - ord('Z') + ord('A')-1)
    
    ss += t

print(ss)
Buggy python submission (verdict: Runtime Error):
#(a*x)をmで割った余りが1になるようなxを求める
#aで割ったときの余りはa^(-1)をかけた余りと同じ
#逆元a^(-1)を求める
#aとmが互いに素であることが条件

def gyakugen( a, m ):
  b = m
  x, y = 1, 0
  while b>0:
    q = a // b
    a, b = b, a-q*b
    x, y = y, x-q*y
  return x if x>0 else x+m


#(a/b)をmで割った余りを求める
#b^(-1)にaを掛けたものをmで割ればよい

def div_remainder(a,b,m):
    b_inv=gyakugen(b,m)
    a%=m
    return (a*b_inv)%m


#(a*b)をmで割った余りを求める

def multi_remainder(a,b,m):
    a%=m
    b%=m
    return (a*b)%m



#nPrをmで割った余りを求める(ただしn<m、mは素数)

def perm_remainder(n,r,m):
    if r>=1:
        return (perm_remainder(n-1,r-1,m)*n)%m
    else:
        return 1

#nCrをmで割った余りを求める(ただしn<m,mは素数)

def comb_remainder(n,r,m):
    r=min(r,n-r)
    return (perm_remainder(n,r,m)*gyakugen(perm_remainder(r,r,m),m))%m


x,y=map(int,input().split())
m=10**9+7
if (2*x-y)%3!=0 or (-x+2*y)%3!=0 or 2*x-y<0 or -x+2*y<0:
  ans=0
else:
  nx=(2*x-y)//3
  n=(x+y)//3
  ans=comb_remainder(n,nx,m)
print(ans)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)
#(a*x)をmで割った余りが1になるようなxを求める
#aで割ったときの余りはa^(-1)をかけた余りと同じ
#逆元a^(-1)を求める
#aとmが互いに素であることが条件

def gyakugen( a, m ):
  b = m
  x, y = 1, 0
  while b>0:
    q = a // b
    a, b = b, a-q*b
    x, y = y, x-q*y
  return x if x>0 else x+m


#(a/b)をmで割った余りを求める
#b^(-1)にaを掛けたものをmで割ればよい

def div_remainder(a,b,m):
    b_inv=gyakugen(b,m)
    a%=m
    return (a*b_inv)%m


#(a*b)をmで割った余りを求める

def multi_remainder(a,b,m):
    a%=m
    b%=m
    return (a*b)%m



#nPrをmで割った余りを求める(ただしn<m、mは素数)

def perm_remainder(n,r,m):
    if r>1:
      return (perm_remainder(n-1,r-1,m)*n)%m
    elif r==1:
      return n
    else:
      return 1

#nCrをmで割った余りを求める(ただしn<m,mは素数)

def comb_remainder(n,r,m):
    r=min(r,n-r)
    return (perm_remainder(n,r,m)*gyakugen(perm_remainder(r,r,m),m))%m


x,y=map(int,input().split())
m=10**9+7
if (2*x-y)%3!=0 or (-x+2*y)%3!=0 or 2*x-y<0 or -x+2*y<0:
  ans=0
else:
  nx=(2*x-y)//3
  n=(x+y)//3
  ans=comb_remainder(n,nx,m)
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
ans='No'
for i in range(10):
  if n//i<10 and n%i==0:
    ans='Yes'

print(ans)

Fixed submission:
n=int(input())
ans='No'
for i in range(1,10):
  if n//i<10 and n%i==0:
    ans='Yes'

print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
c.append(0)
for i in range(n-1):
  if a[i]!=a[i+1]-1:
    c[a[i]]=0
print(sum(b)+sum(c))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
c.append(0)
for i in range(n-1):
  if a[i]!=a[i+1]-1:
    c[a[i]-1]=0
c[a[n-1]-1]=0
print(sum(b)+sum(c))

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
for i in range(n-1):
  if a[i]!=a[i+1]-1:
    c[a[i]]=0
print(sum(b)+sum(c))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
c.append(0)
for i in range(n-1):
  if a[i]!=a[i+1]-1:
    c[a[i]-1]=0
c[a[n-1]-1]=0
print(sum(b)+sum(c))
Buggy python submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
ans='Yes'
a[0]-=1
for i in range(n-1):
  if a[i]>a[i+1]:
    ans='No'
  elif a[i+1]>a[i]:
    a[i+1]-=1
print(ans)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ans='Yes'
a[0]-=1
for i in range(n-1):
  if a[i]>a[i+1]:
    ans='No'
  elif a[i+1]>a[i]:
    a[i+1]-=1
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=[0]*n
c=[]
for m in range(n):
  i=n-m
  x=n%i
  b[i-1]=a[i-1]
  for j in range(2,x+1):
    b[i-1]+=b[j*i-1]
  b[i-1]%=2
  if b[i-1]==1:
    c.append(i-1)

print(len(c))
for i in range(len(c)):
  print(c[i]+1,end=' ')

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=[0]*n
c=[]
for m in range(n):
  i=n-m
  x=n//i
  b[i-1]=a[i-1]
  for j in range(2,x+1):
    b[i-1]+=b[j*i-1]
  b[i-1]%=2
  if b[i-1]==1:
    c.append(i-1)

print(len(c))
for i in range(len(c)):
  print(c[i]+1,end=' ')
Buggy python submission (verdict: Runtime Error):
n=int(input())
p=map(int,input().split())
ans=0
for i in range(1,n-1):
  if p[i-1]<p[i] and p[i]<p[i+1]:
    ans+=1
print(ans)

Fixed submission:
n=int(input())
p=list(map(int,input().split()))
ans=0
for i in range(1,n-1):
  if max(p[i-1],p[i],p[i+1])!=p[i] and min(p[i-1],p[i],p[i+1])!=p[i]:
    ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
l=list(map(int,input().split()))
now=0
k=0
while now<=x and k<=n:
  now+=l[k]
  k+=1
print(k)

Fixed submission:
n,x=map(int,input().split())
l=list(map(int,input().split()))
p=[0]*(n+1)
c=1
for i in range(n):
  p[i+1]=p[i]+l[i]
  if p[i+1]<=x:
    c+=1
print(c)

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

Fixed submission:
n,x=map(int,input().split())
l=list(map(int,input().split()))
p=[0]*(n+1)
c=1
for i in range(n):
  p[i+1]=p[i]+l[i]
  if p[i+1]<=x:
    c+=1
print(c)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
p=10**9+7
a=[int(input()) for i in range(m)]
b=[a[0]-1]
for i in range(m):
  b.append(a[i+1]-a[i]-2)
x=[1]*(max(b)+1)
for i in range(2,max(b)+1):
  x[i]=(x[i-1]+x[i-2])%p

ans=1
if min(b)==-1:
  ans=0
else:
  for i in range(m):
    ans=(ans*x[b[i]])%p
print(ans)

Fixed submission:
n,m=map(int,input().split())
p=10**9+7
a=[int(input()) for i in range(m)]
a.append(n+1)
b=[a[0]-1]
for i in range(m):
  b.append(a[i+1]-a[i]-2)
x=[1]*(max(b)+1)
for i in range(2,max(b)+1):
  x[i]=(x[i-1]+x[i-2])%p

ans=1
if min(b)==-1:
  ans=0
else:
  for i in range(m+1):
    ans=(ans*x[b[i]])%p
print(ans)
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
s=list(input())
if s[k-1]=='A':
  s[k-1]='a'
elif s[k-1]=='B':
  s[k-1]='b'
else:
  s[k-1]='c'
print(s,end='' for i in range(n))

Fixed submission:
n,k=map(int,input().split())
s=list(input())
if s[k-1]=='A':
  s[k-1]='a'
elif s[k-1]=='B':
  s[k-1]='b'
else:
  s[k-1]='c'
for i in range(n):
  print(s[i],end='')

Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
s=input()
if s[k-1]=='A':
  s[k-1]='a'
elif s[k-1]=='B':
  s[k-1]='b'
else:
  s[k-1]='c'
print(s)

Fixed submission:
n,k=map(int,input().split())
s=list(input())
if s[k-1]=='A':
  s[k-1]='a'
elif s[k-1]=='B':
  s[k-1]='b'
else:
  s[k-1]='c'
for i in range(n):
  print(s[i],end='')
Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
ab=[list(map(int,input().split())) for i in range(n)]
ab=sorted(ab)
cost=[]
for i in range(n):
  cost+=[ab[i][0]]*ab[i][1]
print(sum(cost[0:m]))

Fixed submission:
n,m=map(int,input().split())
ab=[list(map(int,input().split())) for i in range(n)]
ab=sorted(ab)
ans=0
d=0
for i in range(n):
  s=min(m-d,ab[i][1])
  ans+=ab[i][0]*s
  d+=s
  if d==m:
    break
print(ans)
Buggy python submission (verdict: Runtime Error):
n=map(int,input().split())
a=list(map(int,input().split()))
x=0
for i in a:
  if i%2==0:
   	x+=1
print(3**n-2**x)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
x=0
for i in a:
  if i%2==0:
   	x+=1
print(3**n-2**x)
Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
s1=[]
sn=[]
ans='IMPOSSIBLE'
for i in range(m):
  a,b=map(int,input().split())
  if a==1:
    s1.append(b)
  elif b==n:
    sn.append(a)
for i in s1:
  if i in sn:
    ans='POSSIBLE'
    break
print(ans)

Fixed submission:
n,m=map(int,input().split())
s1=[]
sn=[]
ans='IMPOSSIBLE'
for i in range(m):
  a,b=map(int,input().split())
  if a==1:
    s1.append(b)
  elif b==n:
    sn.append(a)
s=sorted(s1+sn)
for i in range(len(s)-1):
  if s[i]==s[i+1]:
    ans='POSSIBLE'
    break
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c=map(input().split())
if a==b==c:
  print(-1)
elif a%2==1 or b%2==1 or c%2==1:
  print(0)
else:
  ans=0
  while a%2==0 and b%2==0 and c%2==0:
    ans+=1
    a1=(b+c)//2
    b1=(c+a)//2
    c1=(a+b)//2
    a=a1
    b=b1
    c=c1
  print(ans)

Fixed submission:
a,b,c=map(int,input().split())
if a%2==1 or b%2==1 or c%2==1:
  print(0)
elif a==b==c:
  print(-1)
else:
  ans=0
  while a%2==0 and b%2==0 and c%2==0:
    ans+=1
    a1=(b+c)//2
    b1=(c+a)//2
    c1=(a+b)//2
    a=a1
    b=b1
    c=c1
  print(ans)

Buggy python submission (verdict: Runtime Error):
a,b,c=map(input().split())
if a==b==c:
  print(-1)
elif a%2==1 or b%2==1 or c%2==1:
  print(0)
else:
  ans=0
  while a%2==0 and b%2==0 and c%2==0:
    ans+=1
    a1=(b+c)//2
    b1=(c+a)//2
    c1=(a+b)//2
    a=a1
    b=b1
    c=c1
print(ans)

Fixed submission:
a,b,c=map(int,input().split())
if a%2==1 or b%2==1 or c%2==1:
  print(0)
elif a==b==c:
  print(-1)
else:
  ans=0
  while a%2==0 and b%2==0 and c%2==0:
    ans+=1
    a1=(b+c)//2
    b1=(c+a)//2
    c1=(a+b)//2
    a=a1
    b=b1
    c=c1
  print(ans)
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().spkit())
print(k*(k-1)**(n-1))

Fixed submission:
n,k=map(int,input().split())
print(k*(k-1)**(n-1))
Buggy python submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
s=input()
all=a+b
in=b
for i in range(n):
  if all==0:
    print('No')
  elif s[i]=='a':
    print('Yes')
    all-=1
  elif s[i]=='b' and in>0:
    print('Yes')
    all-=1
    in-=1
  else:
    print('No')

Fixed submission:
n,a,b=map(int,input().split())
s=input()
all=a+b
inter=b
for i in range(n):
  if all==0:
    print('No')
  elif s[i]=='a':
    print('Yes')
    all-=1
  elif s[i]=='b' and inter>0:
    print('Yes')
    all-=1
    inter-=1
  else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[0]+list(map(int,input().split()))
ans=0
for i in n:
  if a[a[i]]==i:
    ans+=1
print(ans)

Fixed submission:
n=int(input())
a=[0]+list(map(int,input().split()))
ans=0
for i in range(1,n+1):
  if a[a[i]]==i:
    ans+=1
print(ans//2)
Buggy python submission (verdict: Runtime Error):
n = int(input())
arr = [0]*10100
for i in range(1,110):
    for j in range(1,110):
        for k in range(1,110):
            s = i*i+j*j+k*k+i*j+j*k+k*i;
            if s<10100:
                ans[s]+=1
for i in range(n):
    print(arr[i+1])

Fixed submission:
n = int(input())
arr = [0]*10100
for i in range(1,110):
    for j in range(1,110):
        for k in range(1,110):
            s = i*i+j*j+k*k+i*j+j*k+k*i;
            if s<10100:
                arr[s]+=1
for i in range(n):
    print(arr[i+1])
Buggy python submission (verdict: Runtime Error):
n,m,k=list(map(int,input().split()))
A=list(map(int,input().split()))
B=list(map(int,input().split()))

a,b=[0],[0]
for i in range(n):
  a.apppend(a[i]+A[i])
 
for i in range(m):
  b.append(b[i] + B[i])
 
ans,j=0,m

for i in range(n+1):
  if a[i] >k:
    break
   while b[j] > k-a[i]:
    j -=1
   
   ans=max(ans,i+j)
    
print(ans)
 

           

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

a=list(map(int,input().split()))

b=list(map(int,input().split()))

A,B=[0],[0]

for i in range(n):
    A.append(A[i] + a[i])

for i in range(m):
    B.append(B[i] + b[i])


ans,j =0,m

for i in range(n+1):
    if A[i] > k:
        break
    while B[j] > k-A[i]:
        j -=1

    ans =max(ans,i+j)

print(ans)
Buggy python submission (verdict: Runtime Error):
N=list(map(int,input().splti()))]
print(15-n[01]-n[1]-n[2]-n[3]-n[4])
     

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

for i in range(len(n)):
  if n[i]==0:
    print(i+1)
Buggy python submission (verdict: Runtime Error):



def fun(n,num,count):

    if count == (num*2)-1:
        return
    print(n,end=" ")
    count +=1
    fun(n+1,num,count)
xnum=list(map(int,input().split()))
x=xnum[0]
num=snum[1]

m=x-(num-1)

fun(m,num,0)


Fixed submission:



def fun(n,num,count):

    if count == (num*2)-1:
        return
    print(n,end=" ")
    count +=1
    fun(n+1,num,count)
xnum=list(map(int,input().split()))
x=xnum[1]
num=xnum[0]

m=x-(num-1)

fun(m,num,0)

Buggy python submission (verdict: Runtime Error):
def fun(n,num,count):

    if count == (num*2)-1:
        return
    print(n,end=" ")
    count +=1
    fun(n+1,num,count)
x=int(input())
num=int(input())
m=x-(num-1)

fun(m,num,0)

Fixed submission:



def fun(n,num,count):

    if count == (num*2)-1:
        return
    print(n,end=" ")
    count +=1
    fun(n+1,num,count)
xnum=list(map(int,input().split()))
x=xnum[1]
num=xnum[0]

m=x-(num-1)

fun(m,num,0)
Buggy python submission (verdict: Time Limit Exceeded):
from random import randint, getrandbits
import time
import sys
input = sys.stdin.readline
start = time.time()

def scoring():
    last = [0] * 26
    res = 0
    penalty = 0
    for i in range(D):
        t = out[i]
        res += S[i][t]
        penalty += sc - (i + 1 - last[t]) * C[t]
        res -= penalty
        last[t] = i + 1
    return res

D = int(input())
C = list(map(int, input().split()))
S = [list(map(int, input().split())) for _ in range(D)]
out = [randint(0, 25) for _ in range(D)]
sc = sum(C)
score = scoring()
while time.time() < start + 1.98:
    if getrandbits(1):
        d = randint(0, D - 1)
        q = randint(0, 25)
        old = out[d]
        out[d] = q
        tmp = scoring()
        if tmp > score:
            score = tmp
        else:
            out[d] = old
    else:
        d1 = randint(0, D - 2)
        d2 = randint(d1 + 1, min(d1 + 16, D - 1))
        out[d1], out[d2] = out[d2], out[d1]
        tmp = scoring()
        if tmp > score:
            score = tmp
        else:
            out[d1], out[d2] = out[d2], out[d1]
for i in out:
    print(i + 1)

Fixed submission:
def scoring(d, t):
    arr = [l for l in last]
    arr[t] = d
    return S[d][t] - sum((d - l) * c for l, c in zip(arr, C))

D = int(input())
C = list(map(int, input().split()))
S = []
for _ in range(D):
    s = list(map(int, input().split()))
    S.append(s)
last = [-1] * 26
ans = []
for i in range(D):
    res = -10 ** 6
    idx = -1
    for j in range(26):
        tmp = scoring(i, j)
        if tmp > res:
            res = tmp
            idx = j
    last[idx] = i
    ans.append(idx+1)
print(*ans, sep='\n')