Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(x) for x in input().split()]

num = {}
for v in a:
  if v in num:
    num[v] = num[v] + 1
  else:
    num[v] = 1
m = int(input())
t = [int(x) for x in input().split()]

ok = True
for v in t:
  if v not in num:
    ok = False
  elif num[v] <= 0:
    ok = False
  else:
    num[v] = num[v] - 1

if ok:
  print("YES")
else:
  ptint("NO")


Fixed submission:
n = int(input())
a = [int(x) for x in input().split()]

num = {}
for v in a:
  if v in num:
    num[v] = num[v] + 1
  else:
    num[v] = 1
m = int(input())
t = [int(x) for x in input().split()]

ok = True
for v in t:
  if v not in num:
    ok = False
  elif num[v] <= 0:
    ok = False
  else:
    num[v] = num[v] - 1

if ok:
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(x) for x in input().split()]

num = {}
for v in a:
  if v in num:
    num[v] = num[v] + 1
  else:
    num[v] = 1
m = int(input())
t = [int(x) for x in input().split()]

ok = True
for v in t:
  if v not in num:
    ok = False
  elif num[v] <= 0:
    ok = False
  else:
    num[v] = num[v] - 1

if ok:
  print("Yes")
else:
  ptint("No")


Fixed submission:
n = int(input())
a = [int(x) for x in input().split()]

num = {}
for v in a:
  if v in num:
    num[v] = num[v] + 1
  else:
    num[v] = 1
m = int(input())
t = [int(x) for x in input().split()]

ok = True
for v in t:
  if v not in num:
    ok = False
  elif num[v] <= 0:
    ok = False
  else:
    num[v] = num[v] - 1

if ok:
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(x) for x in input().split()]

num = {}
for v in a:
  if v in a:
    num[v] = num[v] + 1
  else:
    num[v] = 1
m = int(input())
t = [int(x) for x in input().split()]

ok = True
for v in t:
  if v not in num:
    ok = False
  elif num[v] <= 0:
    ok = False
  else:
    num[v] = num[v] - 1

if ok:
  print("Yes")
else:
  ptint("No")

Fixed submission:
n = int(input())
a = [int(x) for x in input().split()]

num = {}
for v in a:
  if v in num:
    num[v] = num[v] + 1
  else:
    num[v] = 1
m = int(input())
t = [int(x) for x in input().split()]

ok = True
for v in t:
  if v not in num:
    ok = False
  elif num[v] <= 0:
    ok = False
  else:
    num[v] = num[v] - 1

if ok:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int, input().split())

if (b > c) or (a > d):
    print('Yes')
else:
    print('No')

Fixed submission:
x = int(input())
print("ACL" * x)

Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int, input().split())
#b>= x>= a and d>=x>=c

if (b<c )or (a < d):
    print('Yes')
else:
    print('No')

Fixed submission:
x = int(input())
print("ACL" * x)

Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int, input().split())
#b>= x>= a and d>=x>=c

if b<c or a < d:
    print('Yes')
else:
    print('No')

Fixed submission:
x = int(input())
print("ACL" * x)

Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int, input().split())
#b>= x>= a and d>=x>=c

if b<c and a < d:
    print('Yes')
else:
    print('No')

Fixed submission:
x = int(input())
print("ACL" * x)

Buggy python submission (verdict: Runtime Error):
x = input()
print('acl'*x)

Fixed submission:
x = int(input())
print("ACL" * x)

Buggy python submission (verdict: Runtime Error):
x = input()
c = ''
for e in range(x):
	c+='acl'
print(c)

Fixed submission:
x = int(input())
print("ACL" * x)
Buggy python submission (verdict: Runtime Error):
k = int(input())
s = input()

if len(s) <= k:
    print(s)
else:
    print(s[:k+1]+'...')

Fixed submission:
n = input()

hon = ['2','4','5','7','9']
pon = ['0','1','6','8']
bon = ['3']

if n[-1] in bon:
    print('bon')
elif n[-1] in hon:
    print('hon')
elif n[-1] in pon:
    print('pon')

Buggy python submission (verdict: Runtime Error):
k = int(input())
s = input()

if len(s) <= k:
    print(s)
else:
    print(s[:k+1])

Fixed submission:
n = input()

hon = ['2','4','5','7','9']
pon = ['0','1','6','8']
bon = ['3']

if n[-1] in bon:
    print('bon')
elif n[-1] in hon:
    print('hon')
elif n[-1] in pon:
    print('pon')

Buggy python submission (verdict: Runtime Error):
n = input()

hon = [2,4,5,7,9]
pon = [0,1,6,8]
bon = 3

if n in hon:
    print(hon)
elif n in pon:
    print(pon)
elif n == bon:


Fixed submission:
n = input()

hon = ['2','4','5','7','9']
pon = ['0','1','6','8']
bon = ['3']

if n[-1] in bon:
    print('bon')
elif n[-1] in hon:
    print('hon')
elif n[-1] in pon:
    print('pon')
Buggy python submission (verdict: Runtime Error):
k = input()
s = input()

if len(s) <= k:
    print(s)
else:
    print(s[:k+1])

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

if len(s) <= k:
    print(s)
else:
    print(s[:k] + '...')
Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
b = list(map(int, input().split()))
c = b[0]
for i in range(a-1):
  c *= b[i+1]

if c > 1000000000000000000:
  print(-1)
else:
  print(c)

Fixed submission:
a = int(input())
b = list(map(int, input().split()))
b = sorted(b)
c = b[0]
if c == 0:
  print(c)
  exit()
else:
  for i in range(a-1):
    c *= b[i+1]
    if c > 1000000000000000000:
      break

if c > 1000000000000000000:
  print(-1)
else:
  print(c)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
mx=10**18
z=1

a=[int(i) for i in input().split()]
for i in a:
    z*=i

if(z>mx)    : z=-1
print(z)



Fixed submission:
n=int(input())
mx=10**18
z=1

a=[int(i) for i in input().split()]
for i in a:
    if i==0:
        print(0)
        quit()

for i in a:
    z*=i
    if z>mx:    z=-1
    if z==-1:   break

if z>mx or z<0   : z=-1
print(z)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[int(i) for i in input().split(" ")]
mul=1
for a in A:
    mul*=a

if mul>10**18:
    print(-1)
else:
    print(mul)


Fixed submission:
import sys
N=int(input())
A=[int(i) for i in input().split(" ")]
if 0 in A:
    print(0)
    sys.exit(0)
A=sorted(A,reverse=True)
mul=1
for a in A:
    mul*=a

    if mul>10**18:
        print(-1)
        sys.exit(0)

print(mul)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[]
B=[]
for i in range(N):
    _A,_B=[int(i) for i in input().split(" ")]
    A.append(_A)
    B.append(_B)

A=sorted(A)
B=sorted(B)
if N%2==1:
    print(B[(N+1)//2-1]-A[(N+1)//2-1]+1)

else:
    retval=[]
    for x1 in range(A[N//2-1],B[N//2-1]+1):
        for x2 in range(A[N//2],B[N//2]+1):
            retval.append(x1+x2)
    print(len(set(retval)))


Fixed submission:
N=int(input())
A=[]
B=[]
for i in range(N):
    _A,_B=[int(i) for i in input().split(" ")]
    A.append(_A)
    B.append(_B)

A=sorted(A)
B=sorted(B)
if N%2==1:
    print(B[(N+1)//2-1]-A[(N+1)//2-1]+1)

else:
    print(B[N//2-1]-A[N//2-1]+B[N//2]-A[N//2]+1)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[int(i) for i in input().split(" ")]


retval=0
for i in range(N):
    for j in range(i,N):
        if j-i==A[i]+A[j]:
            retval+=1

print(retval)


Fixed submission:
from collections import Counter
N=int(input())
A=[int(i) for i in input().split(" ")]

A2=[i-A[i] for i in range(N)]
A3=[i+A[i] for i in range(N)]

c2=Counter(A2)
c3=Counter(A3)

retval=0
for key in c2+c3:
    retval+=c2[key]*c3[key]

print(retval)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

N=int(input())
A=[int(i) for i in input().split(" ")]
c=Counter(A)
c=dict(c)

for a in A:
    c[a]-=1
    retval=0
    for key in c:
        retval+=c[key]*(c[key]-1)//2
    print(retval)
    c[a]+=1


Fixed submission:
from collections import Counter

N=int(input())
A=[int(i) for i in input().split(" ")]
c=Counter(A)
c=dict(c)
base=0
for key in c:
    base+=c[key]*(c[key]-1)//2


for a in A:
    _base=base
    ca=c[a]
    if ca>1:
        _base-=ca*(ca-1)//2
        _base+=(ca-1)*(ca-2)//2
    print(_base)
Buggy python submission (verdict: Runtime Error):
l=[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(l[K])


Fixed submission:
l=[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(l[K-1])
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=[int(i) for i in input().split(" ")]
mod=10**9+7

def GCD(a,b):
    if min(a,b)==0:
        return max(a,b)
    else:
        return GCD(min(a,b),max(a,b)%min(a,b))

def LCM(a,b):
    return int(a*b/GCD(a,b))


lcm=1
for a in A:
    lcm=LCM(lcm,a)

retval=0
for a in A:
    retval+=lcm/a
    retval=retval%mod

print(int(retval%mod))


Fixed submission:
N=int(input())
A=[int(i) for i in input().split(" ")]
mod=10**9+7

def GCD(a,b):
    if min(a,b)==0:
        return max(a,b)
    else:
        return GCD(min(a,b),max(a,b)%min(a,b))

def LCM(a,b):
    return int(a*b//GCD(a,b))





lcm=1
for a in A:
    lcm=LCM(lcm,a)


retval=0
for a in A:
    retval+=lcm//a

print(int(retval%mod))

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=[int(i) for i in input().split(" ")]
mod=10**9+7

def GCD(a,b):
    if min(a,b)==0:
        return max(a,b)
    else:
        return GCD(min(a,b),max(a,b)%min(a,b))

def LCM(a,b):
    return (a*b/GCD(a,b))


lcm=1
for a in A:
    lcm=LCM(lcm,a)

retval=0
for a in A:
    retval+=lcm/a

print(int(retval%mod))


Fixed submission:
N=int(input())
A=[int(i) for i in input().split(" ")]
mod=10**9+7

def GCD(a,b):
    if min(a,b)==0:
        return max(a,b)
    else:
        return GCD(min(a,b),max(a,b)%min(a,b))

def LCM(a,b):
    return int(a*b//GCD(a,b))





lcm=1
for a in A:
    lcm=LCM(lcm,a)


retval=0
for a in A:
    retval+=lcm//a

print(int(retval%mod))
Buggy python submission (verdict: Runtime Error):
N=int(input())

if N%2==1:
    print(0)
    sys.exit()


N=N//2
retval=0
i=1
while 5**i<=N:
    retval+= N//(5**i)
    i+=1

print(retval)


Fixed submission:
import sys
N=int(input())

if N%2==1:
    print(0)
    sys.exit()


N=N//2
retval=0
i=1
while 5**i<=N:
    retval+= N//(5**i)
    i+=1

print(retval)
Buggy python submission (verdict: Time Limit Exceeded):
N,u,v=[int(i) for i in input().split(" ")]
u-=1
v-=1
graph=[[0 for i in range(N)] for j in range(N)]
for i in range(N-1):
    A,B=[int(j) for j in input().split(" ")]
    graph[A-1][B-1]=1
    graph[B-1][A-1]=1

dist_takahashi=[-1 for i in range(N)]
dist_takahashi[u]=0
next=[u]
d=1
while -1 in dist_takahashi:
    _next=[]
    for n in next:
        for i in range(N):
            if graph[n][i]==1 and dist_takahashi[i]==-1:
                _next.append(i)
    for n in _next:
        dist_takahashi[n]=d
    next=_next
    d+=1

dist_aoki=[-1 for i in range(N)]
dist_aoki[v]=0
next=[v]
d=1
while -1 in dist_aoki:
    _next=[]
    for n in next:
        for i in range(N):
            if graph[n][i]==1 and dist_aoki[i]==-1:
                _next.append(i)
    for n in _next:
        dist_aoki[n]=d
    next=_next
    d+=1


retval=0

for i in range(N):
    if dist_aoki[i]<dist_takahashi[i]:
        continue

    retval=max(retval,dist_aoki[i]-1)


print(retval)


Fixed submission:
N,u,v=[int(i) for i in input().split(" ")]
u-=1
v-=1
graph={}
for i in range(N-1):
    A,B=[int(j) for j in input().split(" ")]
    if A-1 in graph:
        d=graph[A-1]
        d.append(B-1)
        graph[A-1]=d
    else:
        graph[A-1]=[B-1]
    if B-1 in graph:
        d=graph[B-1]
        d.append(A-1)
        graph[B-1]=d
    else:
        graph[B-1]=[A-1]

dist_takahashi=[-1 for i in range(N)]
dist_takahashi[u]=0
next=[u]
d=1
while -1 in dist_takahashi:
    _next=[]
    for n in next:
        nodes=graph[n]
        for i in nodes:
            if dist_takahashi[i]==-1:
                _next.append(i)
    for n in _next:
        dist_takahashi[n]=d
    next=_next
    d+=1

dist_aoki=[-1 for i in range(N)]
dist_aoki[v]=0
next=[v]
d=1
while -1 in dist_aoki:
    _next=[]
    for n in next:
        nodes=graph[n]
        for i in nodes:
            if dist_aoki[i]==-1:
                _next.append(i)
    for n in _next:
        dist_aoki[n]=d
    next=_next
    d+=1


retval=0

for i in range(N):
    if dist_aoki[i]<dist_takahashi[i]:
        continue

    retval=max(retval,dist_aoki[i]-1)


print(retval)
Buggy python submission (verdict: Runtime Error):
N, K=[int(i) for i in input().spit(" ")]
if K==1:
    print(0)
else:
    print(N-K)


Fixed submission:
N, K=[int(i) for i in input().split(" ")]
if K==1:
    print(0)
else:
    print(N-K)
Buggy python submission (verdict: Runtime Error):
import itertools
from collections import Counter
N=int(input())
balls=[]

for i in range(N):
    x,y=[int(j) for j in input().split(" ")]
    balls.append((x,y))

pqs=[]
for i in itertools.permutations(balls,2):
    p=i[1][0]-i[0][0]
    q=i[1][1]-i[0][1]
    pqs.append((p,q))

c=Counter(pqs)
c=dict(c)
c=sorted(c.items(),key=lambda w:w[1],reverse=True)
print(N-c[0][1])


Fixed submission:
import itertools
from collections import Counter
import sys
N=int(input())
balls=[]

for i in range(N):
    x,y=[int(j) for j in input().split(" ")]
    balls.append((x,y))

pqs=[]
if N==1:
    print(1)
    sys.exit()
for i in itertools.permutations(balls,2):
    p=i[1][0]-i[0][0]
    q=i[1][1]-i[0][1]
    pqs.append((p,q))

c=Counter(pqs)
c=dict(c)
c=sorted(c.items(),key=lambda w:w[1],reverse=True)
print(N-c[0][1])
Buggy python submission (verdict: Runtime Error):
import bisect

N=int(input())
A=[int(i) for i in input().split(" ")]
A=sorted(A)
traceback=[]

if A[0]>=0:
    minus=[A[0]]
    plus=A[1::]
elif A[-1]<=0:
    minus=A[:-1:]
    plus=A[-1]
else:
    index=bisect.bisect_left(A,0)
    minus=A[:index:]
    plus=A[index::]

print(sum(plus)-sum(minus))
m=minus.pop(0)
for p in plus[:-1:]:
    print(m,p)
    m=m-p
print(plus[-1],m)
p=plus[-1]-m
for m in minus:
    print(p,m)
    p=p-m


Fixed submission:
import bisect

N=int(input())
A=[int(i) for i in input().split(" ")]
A=sorted(A)
traceback=[]

if A[0]>=0:
    minus=[A[0]]
    plus=A[1::]
elif A[-1]<=0:
    minus=A[:-1:]
    plus=[A[-1]]
else:
    index=bisect.bisect_left(A,0)
    minus=A[:index:]
    plus=A[index::]

print(sum(plus)-sum(minus))
m=minus.pop(0)
for p in plus[:-1:]:
    print(m,p)
    m=m-p
print(plus[-1],m)
p=plus[-1]-m
for m in minus:
    print(p,m)
    p=p-m
Buggy python submission (verdict: Runtime Error):
import itertools
N=int(input())

def returnSplit(N):
    if N%2==0:
        return [[i+1,N-i] for i in range(N//2)]
    else:
        return [[N],*returnSplit(N-1)]


blocks=returnSplit(N)
retval=[]

for i in range(len(blocks)):
    for j in range(i+1,len(blocks)):
        for k in itertools.product(blocks[i],blocks[j]):
            retval.append(k)


print(len(retval))
for i in retval:
    print("{0} {1}".format(*i))


Fixed submission:
import itertools
N=int(input())

def returnSplit(N):
    if N%2==0:
        return [[i+1,N-i] for i in range(N//2)]
    else:
        return returnSplit(N-1)+[[N]]


blocks=returnSplit(N)
retval=[]

for i in range(len(blocks)):
    for j in range(i+1,len(blocks)):
        for k in itertools.product(blocks[i],blocks[j]):
            retval.append(k)


print(len(retval))
for i in retval:
    print("{0} {1}".format(*i))
Buggy python submission (verdict: Runtime Error):
import numpy as np
N,M=[int(i) for i in input().split(" ")]
 
G=np.zeros((N,N),dtype=np.int)
for i in range(N+M-1):
    A,B=[int(j)-1 for j in input().split(" ")]
    G[A][B]=1
for i in range(M):
    x=np.sum(G,axis=0).argmax()
    y=np.sum(G,axis=1).argmax()
    G[y][x]-=1
 
for l in G.T:
    if np.sum(l)==0:
        print("0")
    else:
        print(l.argmax()+1)

Fixed submission:
N,A,B=[int(i) for i in input().split(" ")]
maximum=min(A,B)
minimum=max(A+B-N,0)
print(maximum,minimum)
Buggy python submission (verdict: Time Limit Exceeded):
N,M=[int(i) for i in input().split(" ")]
A=[int(i) for i in input().split(" ")]

_A=[0]

for i in range(N):
    _A.append((_A[-1]+A[i])%M)
count=0





for i in set(_A):
    _count=_A.count(i)

    count+=(_count-1)*_count/2
print(int(count))


Fixed submission:
N,M=[int(i) for i in input().split(" ")]
A=[int(i) for i in input().split(" ")]

_A=[0]
sum=0
d={0:1}
key=[0]
for i in range(N):
    sum=(sum+A[i])%M
    try:
        d[sum]+=1
    except KeyError:
        d[sum]=1
        key.append(sum)

count=0
for i in key:
    _count=d[i]

    count+=(_count-1)*_count/2
print(int(count))

Buggy python submission (verdict: Time Limit Exceeded):
N,M=[int(i) for i in input().split(" ")]
A=[int(i) for i in input().split(" ")]

_A=[sum(A[:i:])%M for i in range(N+1)]

count=0





for i in set(_A):
    _count=_A.count(i)

    count+=(_count-1)*_count/2
print(int(count))


Fixed submission:
N,M=[int(i) for i in input().split(" ")]
A=[int(i) for i in input().split(" ")]

_A=[0]
sum=0
d={0:1}
key=[0]
for i in range(N):
    sum=(sum+A[i])%M
    try:
        d[sum]+=1
    except KeyError:
        d[sum]=1
        key.append(sum)

count=0
for i in key:
    _count=d[i]

    count+=(_count-1)*_count/2
print(int(count))

Buggy python submission (verdict: Time Limit Exceeded):
N,M=[int(i) for i in input().split(" ")]
A=[int(i) for i in input().split(" ")]

_A=[sum(A[:i:])%M for i in range(N+1)]

count=0

_A.sort()


_count=0
for i in range(len(_A)-1):

    if _A[i]==_A[i+1]:
        _count+=1
    else:
        count+=(_count+1)*_count/2
        _count=0

count+=(_count+1)*_count/2
print(int(count))


Fixed submission:
N,M=[int(i) for i in input().split(" ")]
A=[int(i) for i in input().split(" ")]

_A=[0]
sum=0
d={0:1}
key=[0]
for i in range(N):
    sum=(sum+A[i])%M
    try:
        d[sum]+=1
    except KeyError:
        d[sum]=1
        key.append(sum)

count=0
for i in key:
    _count=d[i]

    count+=(_count-1)*_count/2
print(int(count))

Buggy python submission (verdict: Time Limit Exceeded):
N,M=[int(i) for i in input().split(" ")]
A=[int(i) for i in input().split(" ")]

_A=[sum(A[:i:]) for i in range(N+1)]

count=0
for l in range(N+1):
    for r in range(l+1,N+1):

        if (_A[r]-_A[l])%M==0:
                count+=1


print(count)


Fixed submission:
N,M=[int(i) for i in input().split(" ")]
A=[int(i) for i in input().split(" ")]

_A=[0]
sum=0
d={0:1}
key=[0]
for i in range(N):
    sum=(sum+A[i])%M
    try:
        d[sum]+=1
    except KeyError:
        d[sum]=1
        key.append(sum)

count=0
for i in key:
    _count=d[i]

    count+=(_count-1)*_count/2
print(int(count))
Buggy python submission (verdict: Runtime Error):
n,m,d=(int(i) for i in input().split(" "))
if d==0:

    print(((n-d)*(n**(m-2))*(m-1))/(n**m))
else:
    print((2*(n-d)*(n**(m-2))*(m-1))/(n**m))


Fixed submission:
a,b=(int(i) for i in input().split(" "))
if a+b==15:
 print("+")
elif a*b==15:
 print("*")
else:
 print("x")
Buggy python submission (verdict: Runtime Error):
try:
    A=int(input())
    B=int(input())
except:
    A,B=[int(i) for i in input().split(" ")]
if A<=8 and B<=8:
    print("Yay!")
else:
    print(":(")


Fixed submission:
A,B=[int(i) for i in input().split(" ")]
if A<=8 and B<=8:
    print("Yay!")
else:
    print(":(")
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

N,M=[int(i) for i in input().split(" ")]
cake=[]
for i in range(N):
    x,y,z=[int(j) for j in input().split(" ")]
    cake.append([x,y,z])

_num=[i for i in range(N)]
num=list(itertools.combinations(_num,M))

result=0
for i in num:
    delicious=0
    beautiful=0
    popular=0
    for j in i:
        delicious+=cake[j][0]
        beautiful+=cake[j][1]
        popular+=cake[j][2]

    result=max(abs(delicious)+abs(beautiful)+abs(popular),result)

print(result)


Fixed submission:
N,M=[int(i) for i in input().split(" ")]
cake1=[]
cake2=[]
cake3=[]
cake4=[]
cake5=[]
cake6=[]
cake7=[]
cake8=[]
for i in range(N):
    x,y,z=[int(j) for j in input().split(" ")]
    cake1.append(x+y+z)
    cake2.append(-x+y+z)
    cake3.append(x-y+z)
    cake4.append(x+y-z)
    cake5.append(-x-y+z)
    cake6.append(-x+y-z)
    cake7.append(x-y-z)
    cake8.append(-x-y-z)

cake1=sorted(cake1)[::-1]
cake2=sorted(cake2)[::-1]
cake3=sorted(cake3)[::-1]
cake4=sorted(cake4)[::-1]
cake5=sorted(cake5)[::-1]
cake6=sorted(cake6)[::-1]
cake7=sorted(cake7)[::-1]
cake8=sorted(cake8)[::-1]
print(max(sum(cake1[:M:]),sum(cake2[:M:]),sum(cake3[:M:]),sum(cake4[:M:]),sum(cake5[:M:]),sum(cake6[:M:]),sum(cake7[:M:]),sum(cake8[:M:])))
Buggy python submission (verdict: Runtime Error):
line=input()
line.split(" ")
 
a=int(line[0])
b=int(line[1])
c=int(line[2])
 
if a+b==c:
 print("Yes")
elif b+c==a:
 print("Yes")
elif c+a==b:
 print("Yes")
else:
 print("No")

Fixed submission:
line=input()
line=line.split(" ")
 
a=int(line[0])
b=int(line[1])
c=int(line[2])
 
if a+b==c:
 print("Yes")
elif b+c==a:
 print("Yes")
elif c+a==b:
 print("Yes")
else:
 print("No")

Buggy python submission (verdict: Runtime Error):
if a+b==c:
 print("yes")
elif b+c==a:
 print("yes")
elif a+c==b:
 print("yes")
else:
 print("no")

Fixed submission:
line=input()
line=line.split(" ")
 
a=int(line[0])
b=int(line[1])
c=int(line[2])
 
if a+b==c:
 print("Yes")
elif b+c==a:
 print("Yes")
elif c+a==b:
 print("Yes")
else:
 print("No")
Buggy python submission (verdict: Runtime Error):
import sys

inputdata=sys.stdin.readlines()
whn=int(inputdata[0].split( ))
W=whn[0]
H=whn[1]
N=whn[2]
data1=[]
data2=[]
data3=[]
data4=[]
for i in inputdata:
	if i[-1]=="1":
		data1.append(int(i.split( )))
	elif i[-1]=="2":
		data2.append(int(i.split( )))
	elif i[-1]=="3":
		data3.append(int(i.split( )))	
	elif i[-1]=="4":
		data4.append(int(i.split( )))
		
a=0
for i in data1:
	if a<i:
		a=i
b=W
for i in data2:
	if b>i:
		b=i

c=0
for i in data3:
	if c<i:
		c=i					
d=H
for i in data4:
	if d>i:
		d=i
 		
if c>=d:
 	print("0")
elif b<=a:
 	print("0")
else:
 	print(str((d-c)*(b-a)))


Fixed submission:
whn=input().split(" ")
W=int(whn[0])
H=int(whn[1])
N=int(whn[2])
a=[]
for i in range(N):
    a.append(input().split(" "))

left=0
right=W
top=H
bottom=0

for i in range(N):
    if a[i][2]=="1":
        if left<int(a[i][0]):
            left=int(a[i][0])
    elif a[i][2]=="2":
        if right>int(a[i][0]):
            right=int(a[i][0])
    elif a[i][2]=="3":
        if bottom<int(a[i][1]):
            bottom=int(a[i][1])
    elif a[i][2]=="4":
        if top>int(a[i][1]):
            top=int(a[i][1])


if left>=right:
    print(0)
elif top<=bottom:
    print(0)
else:
    print((top-bottom)*(right-left))
Buggy python submission (verdict: Runtime Error):
N=int(input())
ans=1
def test(n):
    buf=0
    for i in range(1,n):
        if i**2 > n:
            break
        if i**2 == n:
            buf+=1
            break
        if n%i==0:
            buf+=2
    return buf

def ans(n):
    if n==2:
        return 1
    return test(n-1) + ans(n - 1)

print(ans(N))


Fixed submission:
N=int(input())
def test(n):
    buf=0
    for i in range(1,n):
        if i**2 > n:
            break
        if i**2 == n:
            buf+=1
            break
        if n%i==0:
            buf+=2
    return buf

ans=0
for i in range(N-1):
    ans+=int((N-1)/(i+1))

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7
MAX = 10**6
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]

for i in range( 2, MAX + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

buf=0
for k in range(1,N+1):
    for j in range(1,N-k+1):
        buf += (cmb(N,k,mod)*cmb(N-k,j,mod)*(8**(N-k-j)%mod))%mod
        buf = buf % mod
print(buf)


Fixed submission:
N=int(input())

mod=10**9+7
def mpow(x,n):
    return x**n % mod

print((mpow(10,N) - 2 * mpow(9,N) + mpow(8,N))%mod)
Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
V=[]
for _ in range(M):
    a,b=map(int,input().split())
    f=True
    for t in V:
        if a in t and b not in t:
            f=False
            t.append(a)
            break
        if a in t and b not in t:
            f=False
            t.append(b)
            break
    if f:
        V.append((a,b))
if M == 0:
    print(1)
else:
    print(max(map(len,V)))


Fixed submission:
D,T,S=map(int,input().split())
print('Yes' if S*T>=D else 'No')