Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
a=list(map(int,input().split()))

old = 0

for i in range(k,n+1):
  if i == k:
    new=1
    for j in range(i-k,i):
      new*=a[j]
  elif i != k:
    new = new / a[i-k-1] * a[i-1]
    if new > old:
      print("Yes")
    else:
      print("No")
  old = new

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

old = 0

for i in range(k,n+1):
  if i == k:
    new = 1
  elif i != k:
    new = a[i-1] / a[i-k-1]
    if new > 1:
      print("Yes")
    else:
      print("No")
  old = new

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
a=list(map(int,input().split()))

old = 0

for i in range(k,n+1):
  new=1
  for j in range(i-k,i):
    new*=a[j]
  if i != k:
    if new > old:
      print("Yes")
    else:
      print("No")
  old = new

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

old = 0

for i in range(k,n+1):
  if i == k:
    new = 1
  elif i != k:
    new = a[i-1] / a[i-k-1]
    if new > 1:
      print("Yes")
    else:
      print("No")
  old = new
Buggy python submission (verdict: Time Limit Exceeded):
import random
import copy

def cal(x):
  Manzoku=0
  l=[0]*26
  for d in range(D):
    l[x[d]-1]=d
    Manzoku+=s[d][x[d]-1]
    for i in range(26):
      Manzoku-=c[i]*(d-l[i])
  return Manzoku

D=int(input())
c=list(map(int,input().split()))
s=[]
t=[]
for i in range(D):
  s.append(list(map(int,input().split())))
l=[0]*26

max=0
target=0
deg=0
#初期t生成
for d in range(D):
  degsum=0
  max=0
  for i in range(26):
    degsum+=c[i]*(d-l[i])
  for i in range(26):
    w=degsum-c[i]*(d-l[i])-s[d][i]
    if max < -w:
      max=-w
      target=i
  t.append(target+1)
  l[target]=d
  
mManzoku=cal(t)
for i in range(100000):
  rd=int(random.random()*D)
  ri=int(random.random()*26)
  t1=copy.deepcopy(t)
  t1[d]=ri+1
  n=cal(t1)
  if mManzoku < n:
    t=copy.deepcopy(t1)
    mManzoku=n

print(mManzoku)
for i in range(D):
  print(t[i])


Fixed submission:
D=int(input())
c=list(map(int,input().split()))
s=[]
t=[]
for i in range(D):
  s.append(list(map(int,input().split())))
l=[0]*26
Manzoku=0

max=0
target=0
deg=0
for d in range(1,D+1):
  for i in range(26):
    deg=c[i]*(d-l[i])
    if max < deg:
      max=deg
      target=i
  t.append(target+1)
  l[target]=d

for i in range(D):
  print(t[i])

Buggy python submission (verdict: Runtime Error):
import copy

def cal(x):
  Manzoku=0
  l=[0]*26
  for d in range(D):
    l[x[d]-1]=d
    Manzoku+=s[d][x[d]-1]
    for i in range(26):
      Manzoku-=c[i]*(d-l[i])
  return Manzoku

D=int(input())
c=list(map(int,input().split()))
s=[]
t=[]
for i in range(D):
  s.append(list(map(int,input().split())))
l=[0]*26


max=0
target=0
deg=0
#初期t生成
for d in range(D):
  for i in range(26):
    deg=c[i]*(d-l[i])
    if max < deg:
      max=deg
      target=i
  t.append(target+1)
  l[target]=d

t1=copy.deepcopy(t)
mManzoku=0
for d in range(D):
  for i in range(26):
    t1[d]=i+1
    su=cal(t1)
    if mManzoku < su:
      mManzoku=su
      tar=i+1
  t1[d]=tar
  

for i in range(D):
  print(t[i])


Fixed submission:
D=int(input())
c=list(map(int,input().split()))
s=[]
t=[]
for i in range(D):
  s.append(list(map(int,input().split())))
l=[0]*26
Manzoku=0

max=0
target=0
deg=0
for d in range(1,D+1):
  for i in range(26):
    deg=c[i]*(d-l[i])
    if max < deg:
      max=deg
      target=i
  t.append(target+1)
  l[target]=d

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

s=0
ac=0
bc=0
max=0

for i in range(n):
  s=s+a[i]
  ac=ac+1
  if s > k:
    s=s-a[i]
    ac=ac-1
    break
for i in range(m):
  s=s+b[i]
  bc=bc+1
  if s > k:
    s=s-b[i]
    bc=bc-1
    break

max=ac+bc

flag=0
while flag==0 && ac!=0:
  ac=ac-1
  s=s-a[ac]
  while s <= k:
    bc=bc+1
    if bc > m:
      flag=1
      break
    s=s+b[bc-1]
  bc=bc-1
  if flag==0:
    s=s-b[bc-1]
  
  if max < ac+bc:
    max=ac+bc
    
print(max)

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

s=0
ac=0
bc=0
max=0

for i in range(n):
  s=s+a[i]
  ac=ac+1
  if s > k:
    s=s-a[i]
    ac=ac-1
    break
for i in range(m):
  s=s+b[i]
  bc=bc+1
  if s > k:
    s=s-b[i]
    bc=bc-1
    break

max=ac+bc

flag=0
while flag==0 and ac!=0:
  ac=ac-1
  s=s-a[ac]
  while s <= k:
    bc=bc+1
    if bc > m:
      flag=1
      break
    s=s+b[bc-1]
  bc=bc-1
  if flag==0:
    s=s-b[bc]
  
  if max < ac+bc:
    max=ac+bc
    
print(max)

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

s=0
count=0

while s <= k:
  if a[0] <= b[0]:
    s=s+a[0]
    count=count+1
    del(a[0])
  else:
    s=s+b[0]
    count=count+1
    del(b[0])
    
print(count-1)

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

s=0
ac=0
bc=0
max=0

for i in range(n):
  s=s+a[i]
  ac=ac+1
  if s > k:
    s=s-a[i]
    ac=ac-1
    break
for i in range(m):
  s=s+b[i]
  bc=bc+1
  if s > k:
    s=s-b[i]
    bc=bc-1
    break

max=ac+bc

flag=0
while flag==0 and ac!=0:
  ac=ac-1
  s=s-a[ac]
  while s <= k:
    bc=bc+1
    if bc > m:
      flag=1
      break
    s=s+b[bc-1]
  bc=bc-1
  if flag==0:
    s=s-b[bc]
  
  if max < ac+bc:
    max=ac+bc
    
print(max)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N, K = list(map(int, input().split()))
A_l = list(map(int, input().split()))

for i in range(N):
    a = A_l[i:i+K]
    b = A_l[i+1:i+K+1]
    if len(a) == K and len(b) == K:
        if np.prod(a) < np.prod(b):
            print('Yes')
        else:
            print('No')
 

Fixed submission:
N, K = list(map(int, input().split()))
A_l = list(map(int, input().split()))

for i in range(N):
    try:
        if A_l[i] < A_l[i+K]:
            print('Yes')
        else:
            print('No')
    except:
        pass
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int, input().split()))

res = 0
for i in range(len(P)):
    if min(P[:i+1]) == P[i]:
        res += 1

print(res)

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

res = 1

minP = P[0]
for i in range(len(P)-1):
    if minP > P[i+1]:
        minP = P[i+1]
        res += 1

print(res)
Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())
Ai = list(map(int, [input() for i in range(Q)]))

final = [K-Q for i in range(N)]
add = [Ai.count(i+1) for i in range(N)]

scores = list(map(lambda x, y: x+y, final, add))

for k in range(len(scores)):
    if scores[k] > 0 :
        print('Yes')
    else:
        print('No')

Fixed submission:
N, K, Q = map(int, input().split())
Ai = list(map(int, [input() for i in range(Q)]))

scores = [K-Q for i in range(N)]

for i in range(Q):
    scores[Ai[i] - 1] += 1
    scores = scores


for k in range(len(scores)):
    if scores[k] > 0 :
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())
Ai = list(map(int, [input() for i in range(Q)]))

scores = []
for i in range(N):
    scores.append(K)

for j in range(Q):
    scores = list(map(lambda x: x - 1, scores)) 
    scores[Ai[j] - 1] += 1
    scores = scores

for k in range(len(scores)):
    if scores[k] > 0 :
        print('Yes')
    else:
        print('No')

Fixed submission:
N, K, Q = map(int, input().split())
Ai = list(map(int, [input() for i in range(Q)]))

scores = [K-Q for i in range(N)]

for i in range(Q):
    scores[Ai[i] - 1] += 1
    scores = scores


for k in range(len(scores)):
    if scores[k] > 0 :
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
si = [''.join(sorted(list(input()))) for i in range(N)]

result = []
for i in si:
    result.append(si.count(i)-1)

print(int(sum(result)/2))


Fixed submission:
from collections import Counter

N = int(input())
si = [''.join(sorted(list(input()))) for i in range(N)]

count = Counter(si)

ans = 0
for s in set(si):
    n = count[s]
    ans += n * (n-1) // 2

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
si = [sorted(list(input())) for i in range(N)]

result = []
for j in range(len(si)):
    a = si.count(si[j])
    result.append(a-1)

print(int(sum(result)/2))

Fixed submission:
from collections import Counter

N = int(input())
si = [''.join(sorted(list(input()))) for i in range(N)]

count = Counter(si)

ans = 0
for s in set(si):
    n = count[s]
    ans += n * (n-1) // 2

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
si = [list(input()) for i in range(N)]

si2 = []
for i in range(len(si)):
    s = []
    for k in list(set(si[i])):
        a = si[i].count(k)
        s.append([k,a])
    si2.append(s)
 
si3 = [] 
for i in range(len(si2)):
    si3.append(sorted(si2[i], key = lambda val : val[0]))

result = []
for i in range(len(si3)):
    result.append(si3.count(si3[i])-1)

print(int(sum(result)/2))

Fixed submission:
from collections import Counter

N = int(input())
si = [''.join(sorted(list(input()))) for i in range(N)]

count = Counter(si)

ans = 0
for s in set(si):
    n = count[s]
    ans += n * (n-1) // 2

print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
count = 0
for i in range(n):
  if a[i] >= b[i]:
    count += b[i]
  else:
    count += min(b[i], a[i]+a[i+1])
    a[i+1] = max(0, a[i+1]-(b[i]-a[i]))
print(count)


Fixed submission:
A, B = map(int, input().split())

if (A+B)%2 == 0:
    result = str((A + B) // 2)
else:
    result =  'IMPOSSIBLE'

print(result)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(input()) for i in range(N)]

for i in range(N):
    tmp = A[i]
    A[i] = 0
    print(max(A))
    A[i] = tmp

Fixed submission:
N = int(input())
A = [int(input()) for i in range(N)]
A2 = sorted(A)

first = A2[-1]
second = A2[-2]

for i in range(N):
    if A[i] == first:
        print(second)
    else:
        print(first)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(input()) for i in range(N)]

for i in range(N):
    print(max(A[:i] + A[i+1:]))

Fixed submission:
N = int(input())
A = [int(input()) for i in range(N)]
A2 = sorted(A)

first = A2[-1]
second = A2[-2]

for i in range(N):
    if A[i] == first:
        print(second)
    else:
        print(first)
Buggy python submission (verdict: Runtime Error):
import math

N = int(input())
i = 0

c = math.log(N-1, 26)
A = list(range(int(c)+1))

while(N!=0):
  c,d = divmod(N-1, 26)
  A[i] = chr(d+97)
  N = c
  i+=1

A.reverse()
print("".join(A))


Fixed submission:
import math

N = int(input())
i = 0

#c = math.log(N-1, 26)
#A = list(range(int(c)+1))
A = []

while(N!=0):
  c,d = divmod(N-1, 26)
  A.append(chr(d+97))
  #A[i] = chr(d+97)
  N = c
  i+=1

A.reverse()
print("".join(A))

Buggy python submission (verdict: Runtime Error):
import math

N = int(input())
i = 0
a,b = divmod(N, 26)
c = math.log(N, 26)
A = list(range(int(c)+1))

while(N!=0):
  c,d = divmod(N-1, 26)
  A[i] = chr(d+97)
  N = c
  i+=1

A.reverse()
#print(A)
print("".join(A))
 

Fixed submission:
import math

N = int(input())
i = 0

#c = math.log(N-1, 26)
#A = list(range(int(c)+1))
A = []

while(N!=0):
  c,d = divmod(N-1, 26)
  A.append(chr(d+97))
  #A[i] = chr(d+97)
  N = c
  i+=1

A.reverse()
print("".join(A))

Buggy python submission (verdict: Runtime Error):
N = int(input())
i = 0
a,b = divmod(N, 26)
A = list(range(a))

while(N!=0):
  c,d = divmod(N-1, 26)
  A[i] = chr(d+97)
  N = c
  i+=1

A.reverse()
print("".join(A))

Fixed submission:
import math

N = int(input())
i = 0

#c = math.log(N-1, 26)
#A = list(range(int(c)+1))
A = []

while(N!=0):
  c,d = divmod(N-1, 26)
  A.append(chr(d+97))
  #A[i] = chr(d+97)
  N = c
  i+=1

A.reverse()
print("".join(A))
Buggy python submission (verdict: Runtime Error):
X = list(map(int, input(),split())
         
for i in X:
	if i == 0:
         print(i+1)

Fixed submission:
X = input().split()
         
for i,num in enumerate(X):
	if num == "0":
		print(int(i)+1)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

A.sort()
num = A[0]
for a in A[1:]:
  num *= a
  if num > 10 ** 18:
    print(-1)
    exit()
print(result)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
 
A.sort()
num = A[0]
for a in A[1:]:
  num *= a
  if num > 10 ** 18:
    print(-1)
    exit()
print(num)

Buggy python submission (verdict: Time Limit Exceeded):
#-*-coding:utf-8-*-
N = int(input())
A = list(map(int,input().split()))

num = 1

for i in A:
  num *= i
if num > 10 ** 18:
  num = -1
    
    
print(num)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
 
A.sort()
num = A[0]
for a in A[1:]:
  num *= a
  if num > 10 ** 18:
    print(-1)
    exit()
print(num)

Buggy python submission (verdict: Time Limit Exceeded):
#-*-coding:utf-8-*-
N = int(input())
A = [int(i) for i in input().split()]

num = 1
for i in range(N):
  num = num * A[i] 

if num > 10 ** 18:
  num = -1
  
print(num)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
 
A.sort()
num = A[0]
for a in A[1:]:
  num *= a
  if num > 10 ** 18:
    print(-1)
    exit()
print(num)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input()]
sum = 1

for i in range(N):
  sum = sum * A[i]

if sum > 10 ** 18:
  sum = -1

print(sum)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
 
A.sort()
num = A[0]
for a in A[1:]:
  num *= a
  if num > 10 ** 18:
    print(-1)
    exit()
print(num)
Buggy python submission (verdict: Runtime Error):
#-*-ccoding:utf-8-*-
k = int(input())
a, b = map(int, input().split())
is_ok = False

for i in range(a,b+1):
  if i % k == 0:
    is_ok = true
    
if is_ok:
  print("OK")
else:
  print("NG")

Fixed submission:
#-*-ccoding:utf-8-*-
k = int(input())
a, b = map(int, input().split())
is_ok = False
 
for i in range(a,b+1):
  if i % k == 0:
    is_ok = True
    
if is_ok:
  print("OK")
else:
  print("NG")
Buggy python submission (verdict: Runtime Error):
s = input()
s1 = s[:n//2]
s2 = s[n//2+1:]
if s1 == s2 and s2 ==  s2[::-1]:
    print('Yes')
else:
    print('No')

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

s1 = s[:(n-1)//2]
s2 = s[(n+3)//2-1:]

if s == s[::-1] and s1 == s1[::-1] and s2 == s2[::-1]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
s = int(input())

if A in s and B in s:
  print("Yes")
else:
  print("No")

Fixed submission:
s = input()
 
if "A" in s and "B" in s:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
S,T = input.split()
A,B = map(int, input().split())
U = input()

if S == U:
  A -= 1
else:
  B -= 1
  
print(A,B)

Fixed submission:
S,T = input().split()
A,B = map(int, input().split())
U = input()
 
if S == U:
  A -= 1
else:
  B -= 1
  
print(A,B)
Buggy python submission (verdict: Runtime Error):
S = input()

S_len = len(S)

print(x* S_len)

Fixed submission:
S = input()
 
S_len = len(S)
 
print("x" * S_len)
Buggy python submission (verdict: Runtime Error):
H, A = map(int,input.split())
count = 0
while H > 0:
  H -= A
  count += 1
  
print(count)

Fixed submission:
H, A = map(int,input().split())
count = 0
while H > 0:
  H -= A
  count += 1
  
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
A,B,K = map(int,input().split())

for i in range(K):
  if A >= 1:
    A -= 1
  elif B >= 1:
    B -= 1
    
print(A,B)

Fixed submission:
A,B,K = map(int,input().split())

if A - K >= 0:
  print(A-K,B)
elif A + B >= K:
  print(0,B+A-K)
else:
  print(0,0)
Buggy python submission (verdict: Runtime Error):
alphabet = list("ABCDEFGHRJKLMNOPQRSTUVWXYZ")
n = int(input())
s = input()
for i in s:
  #print(i, alphabet.index(i))
  print(alphabet[(alphabet.index(i)+n) % 26], end='')

Fixed submission:
alphabet = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
N = int(input())
S = input()
for i in S:
  print(alphabet[(alphabet.index(i)+N) % 26], end='')
Buggy python submission (verdict: Time Limit Exceeded):
from math import sqrt
N = int(input())
S = 0
def f(n):
  ctr = 0
  for j in range (1, n+1//2 + 1):
    if n%j == 0:
      ctr += 1
  return ctr
for i in range (1, N+1):
  ctr = f(i)
  S += i*ctr
print(S)


Fixed submission:
import math
N = int(input())
 
cnt = 0
for i in range(1, int(math.sqrt(N)+1)):
    sub = N//i
    cnt += (sub-i+1)*(sub+i)*i - i**2
cnt = int(cnt)
print(cnt)
Buggy python submission (verdict: Runtime Error):
A = list(map(int, input().split()))
k = A.find(0)
print(k+1)

Fixed submission:
A = list(map(int, input().split()))
k = A.index(0)
print(k+1)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = list(map(int, input().split()))
M = 1
for i in L:
  M *= i
if M > 1000000000000000000:
  print(-1)
else:
  print(M)

Fixed submission:
N = int(input())
L = list(map(int, input().split()))
L.sort()
M = 1
for i in L:
  M *= i
  if M > 10**18:
    M = -1
    break
print(M)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = list(map(int, input().split()))
M = 1
for i in L:
  M *= i
if M > 1000000000000000000:
  print(-1)
else:
  print(M)

Fixed submission:
N = int(input())
L = list(map(int, input().split()))
L.sort()
M = 1
for i in L:
  M *= i
  if M > 10**18:
    M = -1
    break
print(M)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = list(map(int, input().split()))
M = 1
K = 10**18
for i in L:
  M *= i
if M > K:
  print(-1)
else:
  print(M)

Fixed submission:
N = int(input())
L = list(map(int, input().split()))
L.sort()
M = 1
for i in L:
  M *= i
  if M > 10**18:
    M = -1
    break
print(M)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = list(map(int, input().split()))
M = 1
for i in L:
  M *= i
if M > 10**18:
  print(-1)
else:
  print(M)

Fixed submission:
N = int(input())
L = list(map(int, input().split()))
L.sort()
M = 1
for i in L:
  M *= i
  if M > 10**18:
    M = -1
    break
print(M)
Buggy python submission (verdict: Runtime Error):
X = int(input())
A = 100
Y = 0
while A < X:
  A = int(y*1.01)
  Y += 1 
print(Y)

Fixed submission:
X = int(input())
A = 100
Y = 0
while A < X:
  A += A//100
  Y += 1
print(Y)
Buggy python submission (verdict: Runtime Error):
S = input()
S1 = S[:int((len(s)-1)/2)]
S2 = S[int((len(s)+3)/2)-1:]
print('Yes' if S == S[::-1] and S1 == S1[::-1] and S2 == S2[::-1] else 'No')

Fixed submission:
S = input()
S1 = S[:int((len(S)-1)/2)]
S2 = S[int((len(S)+3)/2)-1:]
print('Yes' if S == S[::-1] and S1 == S1[::-1] and S2 == S2[::-1] else 'No')
Buggy python submission (verdict: Runtime Error):
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
X = A + B + C
N = int(input())
L = []
for i in range (N):
  K = int(input())
  L.append(K)
ck = 'No'
if A[1] in L and A[2]in L and A[3] in L:
  ck == 'Yes'
elif B[1] in L and B[2]in L and B[3] in L:
  ck == 'Yes'
elif C[1] in L and C[2]in L and C[3] in L:
  ck == 'Yes'
elif A[1] in L and B[1]in L and C[1] in L:
  ck == 'Yes'
elif A[2] in L and B[2]in L and C[2] in L:
  ck == 'Yes'
elif A[3] in L and B[3]in L and C[3] in L:
  ck == 'Yes'
elif A[1] in L and B[2] in L and C[3] in L:
  ck = 'Yes'
elif A[3] in L and B[2] in L and C[1] in L:
  ck = 'Yes'
print(ck)

Fixed submission:
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
X = A + B + C
N = int(input())
L = []
for i in range (N):
  K = int(input())
  L.append(K)
ck = 'No'
if A[0] in L and A[1]in L and A[2] in L:
  ck = 'Yes'
elif B[0] in L and B[1]in L and B[2] in L:
  ck = 'Yes'
elif C[0] in L and C[1]in L and C[2] in L:
  ck = 'Yes'
elif A[0] in L and B[0]in L and C[0] in L:
  ck = 'Yes'
elif A[1] in L and B[1]in L and C[1] in L:
  ck = 'Yes'
elif A[2] in L and B[2]in L and C[2] in L:
  ck = 'Yes'
elif A[0] in L and B[1] in L and C[2] in L:
  ck = 'Yes'
elif A[2] in L and B[1] in L and C[0] in L:
  ck = 'Yes'
print(ck)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
k = 0
for i in A:
  if i%2 = 1:
    A.remove(i)
for j in A:
  if j%3 != 0 and j%5 != 0:
    k = 1
    break
if k == 0:
  print('APPROVED')
elif k == 1:
  print('DENIED')

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
k = 'APPROVED'
for i in A:
  if i % 2 == 0:
    if i % 3 == 0:
      pass
    elif i % 5 == 0:
      pass
    else:
      k = 'DENIED'
print(k)
Buggy python submission (verdict: Runtime Error):
H,N = map(int, input().split())
A = list(int(input()))
if sum(A) >= H:
  print('Yes')
else:
  print('No')

Fixed submission:
H,N = map(int, input().split())
A = list(map(int, input().split()))
if sum(A) >= H:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
H,N = map(int, input().split())
A = list(int(input().split()))
if sum(A) >= H:
  print('Yes')
else:
  print('No')

Fixed submission:
H,N = map(int, input().split())
A = list(map(int, input().split()))
if sum(A) >= H:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(input())
ctr = 0
for i in range (N):
  if S[i] == 'A' and S[i+1] == 'B' and S[i+2] == 'C':
    ctr += 1
print(ctr)

Fixed submission:
N = int(input())
S = input()
print(S.count('ABC'))

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
ctr = 0
for i in range (N):
  if S(i) == 'A' and S(i+1) == 'B' and S(i+2) == 'C':
    ctr += 1
print(ctr)

Fixed submission:
N = int(input())
S = input()
print(S.count('ABC'))
Buggy python submission (verdict: Time Limit Exceeded):
A,B,K = map(int, input().split())
for i in range (K):
  if A >= 1:
    A -= 1
  elif B >= 1:
    B -= 1
print(A,B)

Fixed submission:
A,B,K = map(int, input().split())
print(max(0,A-K),max(0,B-max(0,K-A)))
Buggy python submission (verdict: Runtime Error):
S = list(input())
for i in range (len(S)):
  if S[2i-2] == 'R' or S[2i-1]  == 'L':
    print('No')
  	quit()
print('Yes')

Fixed submission:
S = input()
A = 'Yes'
for i in range(len(S)):
    if i%2==0 and S[i] == 'L':
        A = 'No'
    elif i%2 == 1 and S[i] == 'R':
        A = 'No'
print(A)
Buggy python submission (verdict: Runtime Error):
S = list(map(input()))
T = list(map(input()))
ctr = 0
for i in range (3):
  if S[i] == T[i]:
    ctr += 1
print(ctr)

Fixed submission:
S = list(input())
T = list(input())
ctr = 0
for i in range (3):
  if S[i] == T[i]:
    ctr += 1
print(ctr)
Buggy python submission (verdict: Runtime Error):
N,D = map(int,input().split())
P = []
for i in range (N):
    P.append(list(map(int, input().split())))
Pi = 0
for i in range(N):
    for j in range(i+1, N):
        Di = 0
        for k in range (D):
            Di += (P[i][k]-P[j][k])**2
        if int(Di**0.5) == dist**0.5:
            Pi += 1
print(Pi)

Fixed submission:
N,D = map(int,input().split())
P = []
for i in range (N):
    P.append(list(map(int, input().split())))
Pi = 0
for i in range(N):
    for j in range(i+1, N):
        Di = 0
        for k in range (D):
            Di += (P[i][k]-P[j][k])**2
        if int(Di**0.5) == Di**0.5:
            Pi += 1
print(Pi)

Buggy python submission (verdict: Runtime Error):
N,D = map(int,input().split())
    P = []
    for i in range (N):
        P.append(list(map(int, input().split())))
    Pi = 0
    for i in range(N):
        for j in range(i+1, N):
            Di = 0
            for k in range (D):
                Di += (P[i][k]-P[j][k])**2
            if int(Di**0.5) == dist**0.5:
                Pi += 1
    print(Pi)

Fixed submission:
N,D = map(int,input().split())
P = []
for i in range (N):
    P.append(list(map(int, input().split())))
Pi = 0
for i in range(N):
    for j in range(i+1, N):
        Di = 0
        for k in range (D):
            Di += (P[i][k]-P[j][k])**2
        if int(Di**0.5) == Di**0.5:
            Pi += 1
print(Pi)