Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n,m,k=map(int,input().split())
if n%k==0 or m%k==0:
    print("Yes")
    exit()
for i in range(1,n+1):
    for j in range(1,m+1):
        if m*i+n*j-2*(i*j)==k:
            print("Yes")
            exit()
print("No")   

Fixed submission:
n,m,k=map(int,input().split())
for i in range(n+1):
    for j in range(m+1):
        if m*i+n*j-2*(i*j)==k:
            print("Yes")
            exit()
print("No")
Buggy python submission (verdict: Runtime Error):
1 2 10 20 15 200

Fixed submission:
print((int(input()))**2-int(input()))
Buggy python submission (verdict: Runtime Error):
a,b,c,d,e,f=map(int,input().split())
ans=100
for i in range(f//(100*a)+1):
    for j in range(f//(100*b)+1):
        s=100*a*i+100*b*j
        if s==0:
            break
        for ii in range((f-100*a)//c+1):
            for jj in range((f-100*a)//d+1):
                t=c*ii+d*jj
                if t==0:
                    break
                u=(100*t)/s
                if s+t<=f and u==f:
                    print(str(s+t)+" "+str(t))
                    exit()
                if s+t<=f and u<e:
                    if ans>e-u:
                        ans=e-u
                        x,y=s,t
print(str(x+y)+" "+str(y))
                    

Fixed submission:
a,b,c,d,e,f=map(int,input().split())
t=100
for i in range(0,f+1,a*100):
    for j in range(0,f-i+1,b*100):
        k=i+j
        if k==0:
            continue
        s=min(f-i-j,(i+j)*e//100)
        for ii in range(0,s+1,c):
            for jj in range(0,s-ii+1,d):
                if t>e-(ii+jj)*100/(i+j):
                    t=e-(ii+jj)*100/(i+j)
                    x,y=ii+jj+i+j,ii+jj
print(str(x)+" "+str(y))
Buggy python submission (verdict: Runtime Error):
N=int(input())
d={}
for i in list(map(int,input().split())):
    d[i]=d.get(i,0)+1
d=list(d.values())
if len(d)<3:
    ans=sum(d)
else:    
    for j in range(len(d)-2):
        s=d[j]+d[j+1]+d[j+2]
        if s>ans:
            ans=s
print(ans)

Fixed submission:
from collections import Counter
N=int(input())
s=[]
for i in list(map(int,input().split())):
    s+=[i-1,i,i+1]
s=Counter(s)
print(s.most_common(1)[0][1])

Buggy python submission (verdict: Runtime Error):
N=int(input())
d={}
for i in list(map(int,input().split())):
    d[i]=d.get(i,0)+1
d=list(d.values())
if len(d)<3:
    ans=sum(d)
else:    
    for j in range(len(d)-2):
        s=d[j]+d[j+1]+d[j+2]
        if s>ans:
            ans=s
print(ans)

Fixed submission:
from collections import Counter
N=int(input())
s=[]
for i in list(map(int,input().split())):
    s+=[i-1,i,i+1]
s=Counter(s)
print(s.most_common(1)[0][1])

Buggy python submission (verdict: Runtime Error):
N=int(input())
d={}
for i in list(map(int,input().split())):
    d[i]=d.get(i,0)+1
d=list(d.values())
if len(d)>=3:
    for j in range(len(d)-2):
        s=d[j]+d[j+1]+d[j+2]
        if s>ans:
            ans=s
else:
    ans=max(d)
print(ans)

Fixed submission:
from collections import Counter
N=int(input())
s=[]
for i in list(map(int,input().split())):
    s+=[i-1,i,i+1]
s=Counter(s)
print(s.most_common(1)[0][1])
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
s=[int(input()) for i in range(N)]
i=0
while i>=0 :
    i+=1
    for j in range(N):
        if (max(s)*i)%s[j]!=0:
            break
    else:
        print(max(s)*i)
        exit()

Fixed submission:
def f(a,b):
    x,y=a,b
    while b>0:
        a,b=b,a%b
    return (x//a)*y
s=1    
N=int(input())
for i in range(N):
    a=s
    b=int(input())
    s=f(a,b)
print(s)
Buggy python submission (verdict: Runtime Error):
N=int(input())
s=list(input().split())
t=s[5::-2]+s[0::2]
for i in range(N):
    print(t[i],end=" ")




Fixed submission:
N=int(input())
s=list(input().split())
if N>=2:
    t=s[N::-2]+s[N%2::2]
    for i in range(N):
        print(t[i],end=" ")
else:
    print(s[0])
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
s=[int(input())  for i in range(N)]
ans=0
for k in range(2**N):
    t=0
    for j in range(N):
        if k&2**j:
            t+=s[j]
    if t%10==0:
        continue
    ans=max(ans,t)
    ans=t
print(ans)  

Fixed submission:
N=int(input())
s=sorted([int(input())  for i in range(N)])
if sum(s)%10!=0:
    print(sum(s))
else:
    for j in range(N):
        if s[j]%10!=0:
            print(sum(s)-s[j])
            break
    else:
        print(0)
Buggy python submission (verdict: Runtime Error):
N=int(input())
s=list(map(int,input().split()))
if s[0]<0:
    t=1
elif s[0]>0:
    t=-1
ss=s[0]   
w=0
for i in range(N-1):
    if t==1:
        if ss+s[i+1]>=t:
            ss=ss+s[i+1]
            pass
        else:
            w+=t-ss-s[i+1]
            ss=1
        t=-1
    elif t==-1:
        if ss+s[i+1]<=t:
            ss=ss+s[i+1]
            pass
        else:
            w+=ss+s[i+1]-t
            ss=-1
        t=1
print(w)        
                
            
            
            
        
        

Fixed submission:
# coding: utf-8
# hello worldと表示する
N=int(input())
s=list(map(int,input().split()))
def f(N,s,t):
    ss=0
    w=0
    for i in range(N):
        ss+=s[i]
        if t==1:
            if ss<=0:
                w+=1-ss
                ss=1
            t=-1    
        elif t==-1:
            if ss>=0:
                w+=1+ss
                ss=-1
            t=1
    return w
t=1
a=f(N,s,t)
t=-1
b=f(N,s,t)
print(min(a,b))
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
s=sorted([input() for i in range(m)])
print("".join(s))

Fixed submission:
N,M=map(int,input().split())
s=[]
for i in range(N):
    s.append(input())
print("".join(sorted(s)))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)


    return divisors
l=make_divisors(n)


aa=0
bb=0
for i in range(len(l)):

    t=0
    a=0
    while t==0:
        if a**5-(a-l[i])**5==n:
            t=2
            aa=a
            bb=a-l[i]

        elif a>l[i] and a**5-(a-l[i])**5>n:
            t=1

        a+=1

print(str(aa)+" "+str(bb))


Fixed submission:
N= int(input())
x=0
a=0


for a in range(121):
    for b in range(-120,120):
        x = a ** 5 - b ** 5
        if x==N:
            an=str(a)+" "+str(b)
print(an)
Buggy python submission (verdict: Runtime Error):
a,b,n = map(int, input().split())

t=0
xx=1
l=[-1]*(b+1)
p=1
d=b//a
if d==0:
   d=1
if n>=b and b>1:
   while t == 0 and xx <= n:
      c=a*xx%b
      if l[c]==-1:
         l[c]=xx
      else:
         t=1
      xx+=d
   while t>-1:

      if l[p]>-1:
         t=-2
         x=l[p]
      p+=1
else:
   x=n
print(a*x//b-a*(x//b))


Fixed submission:

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


if n>=b-1:
    x=b-1
else:
    x=n
print(a*x//b-a*(x//b))

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

t=0
xx=1
l=[-1]*(b+1)
p=1
d=b//a
if n>=b and b>1:
   while t == 0 and xx <= n:
      c=a*xx%b
      if l[c]==-1:
         l[c]=xx
      else:
         t=1
      xx+=d
   while t>-1:

      if l[p]>-1:
         t=-2
         x=l[p]
      p+=1
else:
   x=n
print(a*x//b-a*(x//b))


Fixed submission:

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


if n>=b-1:
    x=b-1
else:
    x=n
print(a*x//b-a*(x//b))

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

t=0
xx=0
l=[-1]*(b+1)
p=1
if n>=b and b>1:
   while t == 0 and xx <= n:
      xx += 1
      c=a*xx%b
      if l[c]==-1:
         l[c]=xx
      else:
         t=1
   while t>-1:

      if l[p]>-1:
         t=-2
         x=l[p]
      p+=1
else:
   x=n
print(a*x//b-a*(x//b))


Fixed submission:

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


if n>=b-1:
    x=b-1
else:
    x=n
print(a*x//b-a*(x//b))

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

t=0
xx=0
l=[-1]*(b+1)
p=1
if n>b and b>1:
   while t == 0 and xx <= n:
      xx += 1
      c=a*xx%b
      if l[c]==-1:
         l[c]=xx
      else:
         t=1
   while t>-1:

      if l[p]>-1:
         t=-2
         x=l[p]
      p+=1
else:
   x=n
print(a*x//b-a*(x//b))


Fixed submission:

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


if n>=b-1:
    x=b-1
else:
    x=n
print(a*x//b-a*(x//b))

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

t=0
xx=0
l=[-1]*b
p=1
if n>b:
   while t == 0 and xx <= n:
      xx += 1
      c=a*xx%b
      if l[c]==-1:
         l[c]=xx
      else:
         t=1
   while t>-1:

      if l[p]>-1:
         t=-2
         x=l[p]
      p+=1
else:
   x=n
print(a*x//b-a*(x//b))

Fixed submission:

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


if n>=b-1:
    x=b-1
else:
    x=n
print(a*x//b-a*(x//b))

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

t=0
xx=0
l=[0]*b
p=1
if a<b:
   while t == 0 and xx <= n:
      xx += 1
      c=a*xx%b
      if l[c]==0:
         l[c]=xx
      else:
         t=1
   while t>-1:

      if l[p]>0:
         t=-2
         x=l[p]
      p+=1



else:
   x=n
print(a*x//b-a*(x//b))

Fixed submission:

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


if n>=b-1:
    x=b-1
else:
    x=n
print(a*x//b-a*(x//b))
Buggy python submission (verdict: Time Limit Exceeded):
N =int(input())
A = list(map(int, input().split()))

k=0
t=1
for i in range(1,N):
    print(A.count(i))
print(0)


Fixed submission:
import collections
N =int(input())
A = list(map(int, input().split()))

k=0
t=1
a=collections.Counter(A)
for i in range(1,N+1):
    print(a[i])
Buggy python submission (verdict: Time Limit Exceeded):
import math
N= int(input())
a=0
b=0
for i in range(1,N+1):
    for j in range(1, N + 1):
        for k in range(1, N + 1):
            b=math.gcd(i,j)
            a+=math.gcd(b,k)
print(a)

Fixed submission:
import math
N= int(input())
a=0
b=0
for i in range(1,N+1):
    for j in range(1, N + 1):
        b = math.gcd(i, j)
        for k in range(1, N + 1):
            a+=math.gcd(b,k)
print(a)
Buggy python submission (verdict: Time Limit Exceeded):
S= input()
q=int(input())
h=0
for i in range(q):
    a=input()


    if a[0]=="1":
        h+=1
    else:
        if h%2==0:
            if a[2] == "1":
                S=a[4]+S
            else:
                S=S+a[4]
        else:
            if a[2] == "2":
                S=a[4]+S
            else:
                S=S+a[4]

if h%2==0:
    print(S)
else:
    print(S[::-1])

Fixed submission:
S= input()
q=int(input())
h=0
a=[]
for i in range(q):
    a.append(input())
t=""
w=""
for i in range(1,q+1):
    if a[q-i][0]=="2":
        if a[q - i][2] == "1":
            if h%2==0:
                t=t+a[q-i][4]
            else:
                w =  w+a[q - i][4]
        else:
            if h%2==0:
                w=w+a[q-i][4]
            else:
                t = t + a[q - i][4]
    else:
        h+=1
if h%2==0:
    print(t+S+w[::-1])
else:
    print(t+S[::-1]+w[::-1])

Buggy python submission (verdict: Time Limit Exceeded):
S= input()
q=int(input())

for i in range(q):
    a=input()


    if a[0]=="1":
        S=S[::-1]
    else:
        if a[2] == "1":
            S=a[4]+S
        else:
            S=S+a[4]

print(S)

Fixed submission:
S= input()
q=int(input())
h=0
a=[]
for i in range(q):
    a.append(input())
t=""
w=""
for i in range(1,q+1):
    if a[q-i][0]=="2":
        if a[q - i][2] == "1":
            if h%2==0:
                t=t+a[q-i][4]
            else:
                w =  w+a[q - i][4]
        else:
            if h%2==0:
                w=w+a[q-i][4]
            else:
                t = t + a[q - i][4]
    else:
        h+=1
if h%2==0:
    print(t+S+w[::-1])
else:
    print(t+S[::-1]+w[::-1])
Buggy python submission (verdict: Runtime Error):
if N%2==0:
    print(N/2)
else:
    print((N+1)/2)


Fixed submission:
N = int(input())
print((N+1)//2)
Buggy python submission (verdict: Time Limit Exceeded):
import copy

N,C=map(int,input().split())
channel=[tuple(map(int,input().split())) for i in range(N)]
channel=sorted(channel,key=lambda cha: cha[0])

n=0
while(channel!=[]):
    c=copy.copy(channel)
    n+=1
    pro=channel[0]
    c.remove(pro)
    for i in channel:
        if i[0]>pro[1]:
            pro=i
            c.remove(pro)
    channel=c
print(n)


Fixed submission:
N,C=map(int,input().split())
channel=[tuple(map(int,input().split())) for i in range(N)]
channel=sorted(channel,key=lambda cha: cha[0])

n=0
while(channel!=[]):
    c=[]
    n+=1
    pro=channel[0]
    channel.remove(pro)
    for i in channel:
        if i[0]>pro[1]:
            pro=i
        elif(i[0]==pro[1] and i[2]==pro[2]):
            pro=i
        else:
            c.append(i)
    channel=c
print(n)
Buggy python submission (verdict: Runtime Error):
H,W=map(int,input().split())
C=[0 for i in range(9)]
for i in range(9):
    C[i]=map(int,input().split())
A=[0 for i in range(H)]
for i in range(H):
    A[i]=map(int,input().split())

    
def mini(S,dic,ans):
    if(S=={0,1,2,3,4,5,6,7,8}):
        return ans
    min_val=min(dic.items())
    for i in dic.keys():
        if dic[i]==min_val:
            S.add(i)
            pos=i
            break
    ans[pos]=dic.pop(pos)
    for i in dic.keys():
        dic[i]=min([dic[i],dic[pos]+C[pos][0]])
    mini(S,dic,ans)

dic={}
for i in range(9):
    dic[i]=C[i][0]
M=mini({},dic,{})
M[-1]=0

ans=0
for i in range(H):
    for j in range(W):
        ans+=M[A[i][j]]
print(ans)


Fixed submission:
H,W=map(int,input().split())
C=[0 for i in range(10)]
for i in range(10):
    C[i]=list(map(int,input().split()))
A=[0 for i in range(H)]
for i in range(H):
    A[i]=list(map(int,input().split()))

    
def mini(S,dic,ans):
    if(S=={0,1,2,3,4,5,6,7,8,9}):
        return ans
    min_val=min(dic.values())
    for i in dic.keys():
        if dic[i]==min_val:
            S.add(i)
            pos=i
            break
    ans[pos]=dic.pop(pos)
    for i in dic.keys():
        dic[i]=min([dic[i],ans[pos]+C[i][pos]])
    return mini(S,dic,ans)

dic={}
for i in range(10):
    dic[i]=C[i][1]
M=mini(set(),dic,{})
M[-1]=0

ans=0
for i in range(H):
    for j in range(W):
        ans+=M[A[i][j]]
print(ans)
Buggy python submission (verdict: Runtime Error):
X,Y=input().split()

dic={"A":1,"B":2,"C":3,"D":4,"E":5,"F":6}

if(dic[X]<dix[Y]):
    print("<")
elif(dic[X]>dic[Y]):
    print(">")
else:
    print("=")


Fixed submission:
X,Y=input().split()

dic={"A":1,"B":2,"C":3,"D":4,"E":5,"F":6}

if(dic[X]<dic[Y]):
    print("<")
elif(dic[X]>dic[Y]):
    print(">")
else:
    print("=")
Buggy python submission (verdict: Runtime Error):
x,y,z=map(int,input().split())

n=0
while(1):
    if(n*y+(n+1)*z>x):
        break
    n+=1

return(n)

Fixed submission:
x,y,z=map(int,input().split())

n=0
while(1):
    if(n*y+(n+1)*z>x):
        break
    n+=1

print(n-1)
Buggy python submission (verdict: Runtime Error):
N=input(N)

x=int(N**0.5)
print(x**2)

Fixed submission:
N=int(input())

x=int(N**0.5)
print(x**2)
Buggy python submission (verdict: Time Limit Exceeded):
N=input()
T=[]
A=[]
for i in range(N):
    Ti,Ai=map(int,raw_input().split())
    T.append(Ti)
    A.append(Ai)

Tn=1
An=1

for i in range(N):
    n=1
    while True:
        if Tn>n*T[i] or An>n*A[i]:
            n=2*n

        else:
            break
    n=n/2
    while True:
        if Tn>n*T[i] or An>n*A[i]:
            n+=1

        else:
            break
    
            
    
    Tn=n*T[i]
    An=n*A[i]

print Tn+An

Fixed submission:
N=input()
T=[]
A=[]
for i in range(N):
    Ti,Ai=map(int,raw_input().split())
    T.append(Ti)
    A.append(Ai)

Tn=1
An=1

for i in range(N):
    T_res=Tn%T[i]
    A_res=An%A[i]
    if T_res==0:
        T_q=Tn/T[i]
    else:
        T_q=(Tn+T[i]-T_res)/T[i]
    if A_res==0:
        A_q=An/A[i]
    else:
        A_q=(An+A[i]-A_res)/A[i]

    q=max(T_q,A_q)

    Tn=q*T[i]
    An=q*A[i]
        
        
print Tn+An

Buggy python submission (verdict: Time Limit Exceeded):
N=input()
T=[]
A=[]
for i in range(N):
    Ti,Ai=map(int,raw_input().split())
    T.append(Ti)
    A.append(Ai)

Tn=0 
An=0

for i in range(N):
    n=1
    while True:
        if Tn>n*T[i] or An>n*A[i]:
            n+=1

        else:
            break
    Tn=n*T[i]
    An=n*A[i]

print Tn+An


Fixed submission:
N=input()
T=[]
A=[]
for i in range(N):
    Ti,Ai=map(int,raw_input().split())
    T.append(Ti)
    A.append(Ai)

Tn=1
An=1

for i in range(N):
    T_res=Tn%T[i]
    A_res=An%A[i]
    if T_res==0:
        T_q=Tn/T[i]
    else:
        T_q=(Tn+T[i]-T_res)/T[i]
    if A_res==0:
        A_q=An/A[i]
    else:
        A_q=(An+A[i]-A_res)/A[i]

    q=max(T_q,A_q)

    Tn=q*T[i]
    An=q*A[i]
        
        
print Tn+An
Buggy python submission (verdict: Runtime Error):
W,H=map(int,raw_input().split())
p=[input() for i in range(W)]
q=[input() for i in range(H)]

p.sort(reverse=True)
q.sort(reverse=True)

cost=0
del_H=0
del_W=0
len_p=W
len_q=H

while len_p>0 and len_q>0:
    
    if p[0]>q[0]:
        del_W+=1
        cost+=p[0]*(del_H+1)
        del p[0]
        len_p-=1
    else:
        del_H+=1
        cost+=q[0]*(del_W+1)
        del q[0]
        len_q-=1
        

if len_p==0:
    cost+=sum(q)*(W+1)

else:
    cost+=sum(p)*(H+1)

print cost


Fixed submission:
s=raw_input()
true_s='CODEFESTIVAL2016'

error_number=0

for i in range(16):
    if s[i]!=true_s[i]:
        error_number+=1


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

n = input()
N = int(n)
A = [int(a) for a in input().split()]
q = input()
Q = int(q)
B, C = [], []
for i in range(Q):
    b, c = input().split()
    B.append(int(b))
    C.append(int(c))


my_dict = Counter(A)

def cals_sum(my_dict):
    values = [ my_dict[key]*key for key in my_dict.keys() if my_dict[key] != 0]
    #for key in my_dict.keys():
    #    value = my_dict[key]
    #    sum += int(key) * int(value)
    return sum(values)

for i in range(len(B)):
    b = B[i]
    c = C[i]
    tmpb = my_dict[b] 
    my_dict[b] = 0
    tmpc = my_dict[c]
    my_dict[c] = tmpb + tmpc

    print(cals_sum(my_dict))




Fixed submission:
from collections import Counter

n = input()
N = int(n)
A = [int(a) for a in input().split()]
q = input()
Q = int(q)
B, C = [], []
for i in range(Q):
    b, c = input().split()
    B.append(int(b))
    C.append(int(c))


my_dict = Counter(A)

def cals_sum(my_dict):
    values = [ my_dict[key]*key for key in my_dict.keys() if my_dict[key] != 0]
    #for key in my_dict.keys():
    #    value = my_dict[key]
    #    sum += int(key) * int(value)
    return sum(values)
  
my_sum = cals_sum(my_dict)

for i in range(len(B)):
    b = B[i]
    c = C[i]
    tmpb = my_dict[b] 
    my_dict[b] = 0
    tmpc = my_dict[c]
    my_dict[c] = tmpb + tmpc
    
    my_sum += ((tmpb)*c - tmpb*b)

    print(my_sum)

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

n = input()
N = int(n)
A = [int(a) for a in input().split()]
q = input()
Q = int(q)
B, C = [], []
for i in range(Q):
    b, c = input().split()
    B.append(int(b))
    C.append(int(c))


my_dict = Counter(A)

def cals_sum(my_dict):
    sum = 0
    for key in my_dict.keys():
        value = my_dict[key]
        sum += int(key) * int(value)
    return sum

for i in range(len(B)):
    b = B[i]
    c = C[i]
    tmpb = my_dict[b] 
    my_dict[b] = 0
    tmpc = my_dict[c]
    my_dict[c] = tmpb + tmpc

    print(cals_sum(my_dict))

Fixed submission:
from collections import Counter

n = input()
N = int(n)
A = [int(a) for a in input().split()]
q = input()
Q = int(q)
B, C = [], []
for i in range(Q):
    b, c = input().split()
    B.append(int(b))
    C.append(int(c))


my_dict = Counter(A)

def cals_sum(my_dict):
    values = [ my_dict[key]*key for key in my_dict.keys() if my_dict[key] != 0]
    #for key in my_dict.keys():
    #    value = my_dict[key]
    #    sum += int(key) * int(value)
    return sum(values)
  
my_sum = cals_sum(my_dict)

for i in range(len(B)):
    b = B[i]
    c = C[i]
    tmpb = my_dict[b] 
    my_dict[b] = 0
    tmpc = my_dict[c]
    my_dict[c] = tmpb + tmpc
    
    my_sum += ((tmpb)*c - tmpb*b)

    print(my_sum)
Buggy python submission (verdict: Runtime Error):
s = input().split()
s = [float(i) for i in s]

#delete numbers under 0.001 order
tmp = int((s[0] * int(s[1]*100) /100)
print(tmp)

Fixed submission:
a, b = input().split()
a = int(a)
b_new = int(b.replace('.',''))
ans = (a * b_new)// 100
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
I={"ac":0,"wa":0,"tle":0,"re":0}
for i in n:
  I[input()]+=1
print("AC x {}".format(I["ac"]))
print("WA x {}".format(I["wa"]))
print("TLE x {}".format(I["tle"]))
print("RE x {}".format(I["re"]))


Fixed submission:
n=int(input())
I={"AC":0,"WA":0,"TLE":0,"RE":0}
for i in range(n):
  I[input()]+=1
print("AC x {}".format(I["AC"]))
print("WA x {}".format(I["WA"]))
print("TLE x {}".format(I["TLE"]))
print("RE x {}".format(I["RE"]))
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
ans = [i for i in range(1,n+1)]
for i in range(k):
    input()
	a=list(map(int,input().split()))
	for j in a:
      if j in ans:
        ans.remove(j)
print(len(ans))

Fixed submission:
n,k=map(int,input().split())
ans = [i for i in range(1,n+1)]
for i in range(k):
  input()
  a=list(map(int,input().split()))
  for j in a:
    if j in ans:
      ans.remove(j)
print(len(ans))

Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
ans = [i for i in range(1,n+1)]
for i in range(k):
	a=list(map(int,input().split()))
	for j in a:
      if j in ans:
        ans.remove(j)
print(len(ans))

Fixed submission:
n,k=map(int,input().split())
ans = [i for i in range(1,n+1)]
for i in range(k):
  input()
  a=list(map(int,input().split()))
  for j in a:
    if j in ans:
      ans.remove(j)
print(len(ans))

Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
ans = [i for i in range(1,n+1)]
for i in range(k):
    input()
	a=list(map(int,input()))
	for j in a:
      if j in ans:
        ans.remove(j)
print(len(ans))

Fixed submission:
n,k=map(int,input().split())
ans = [i for i in range(1,n+1)]
for i in range(k):
  input()
  a=list(map(int,input().split()))
  for j in a:
    if j in ans:
      ans.remove(j)
print(len(ans))

Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
ans = [i for i in range(1,n+1)]
for i in range(k):
	a=list(map(int,input()))
	for j in a:
      if j in ans:
        ans.remove(j)
print(len(ans))

Fixed submission:
n,k=map(int,input().split())
ans = [i for i in range(1,n+1)]
for i in range(k):
  input()
  a=list(map(int,input().split()))
  for j in a:
    if j in ans:
      ans.remove(j)
print(len(ans))
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
h=list(map,input().split())
x=[[] for i in range(n)]
for i in range(m):
  a,b=map(int,input().split())
  x[a-1].append(b-1)
  x[b-1].append(a-1)
c=0
for i in range(n):
  f=1
  maxh=0
  for j in x[i]:
    maxh=max(maxh,h[j])
  if maxh>=h[i]:
    f=0
  c+=f
print(c)

Fixed submission:
n,m=map(int,input().split())
h=list(map(int,input().split()))
x=[[] for i in range(n)]
for i in range(m):
  a,b=map(int,input().split())
  x[a-1].append(b-1)
  x[b-1].append(a-1)
c=0
for i in range(n):
  f=1
  maxh=0
  for j in x[i]:
    maxh=max(maxh,h[j])
  if maxh>=h[i]:
    f=0
  c+=f
print(c)
Buggy python submission (verdict: Runtime Error):
a=int(input())
b,c=map(int,input())
if c-b>=c%a:
  print("Yes")
else:
  print("No")

Fixed submission:
a=int(input())
b,c=map(int,input().split())
if c-b>=c%a:
  print("OK")
else:
  print("NG")
Buggy python submission (verdict: Runtime Error):
print(["No","Yes"][int("7" in input())]

Fixed submission:
print(["No","Yes"][int("7" in input())])
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=0
k=n//15
a+=60*k**2
While 0==n%15:
  if not n%3==0 and not n%5==0:
    a+=n
  n-=0
print(a)

Fixed submission:
n=int(input())
a=0
k=n//15
a+=60*k**2
while not 0==n%15:
  if not n%3==0 and not n%5==0:
    a+=n
  n-=1
print(a)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=0
k=n//15
a+=60*k**2
While 0=n%15:
  if not n%3=0 and not n%5=0:
    a+=n
  n-=0
print(a)

Fixed submission:
n=int(input())
a=0
k=n//15
a+=60*k**2
while not 0==n%15:
  if not n%3==0 and not n%5==0:
    a+=n
  n-=1
print(a)