Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
L = []
for val in rnage(n):
    L.append(val)

L = sorted(L)
ans_L = []
for i in range(n-k+1):
    ans = L[i+k-1] - L[i]
    ans_L.append(ans)
print(min(ans_L))


Fixed submission:
n,k = map(int,input().split())
L = []
for val in range(n):
    val = int(input())
    L.append(val)

L = sorted(L)
ans_L = []
for i in range(n-k+1):
    ans = L[i+k-1] - L[i]
    ans_L.append(ans)
print(min(ans_L))

Buggy python submission (verdict: Runtime Error):
n.k = map(int,input().split())
L = []
for val in rnage(n):
    L.append(val)

L = sorted(L)
ans_L = []
for i in range(n-k+1):
    ans = L[i+k-1] - L[i]
    ans_L.append(ans)
print(min(ans_L))

Fixed submission:
n,k = map(int,input().split())
L = []
for val in range(n):
    val = int(input())
    L.append(val)

L = sorted(L)
ans_L = []
for i in range(n-k+1):
    ans = L[i+k-1] - L[i]
    ans_L.append(ans)
print(min(ans_L))
Buggy python submission (verdict: Runtime Error):
x,y = map(int,input())
print(int(x+y/2))

Fixed submission:
x,y = map(int,input().split())
print(int(x+y/2))
Buggy python submission (verdict: Runtime Error):
mport copy
n,m = map(int,input().split())

dic = {}
for i in range(m):
    c,y = map(int,input().split())
    dic[y] = c
#print(dic)

dic2 = copy.deepcopy(dic)
#print(dic)
dic2 = sorted(dic2.items(),key=lambda x:x[1],reverse=True)
dic2 = sorted(dic2.items(),key=lambda x:x[0])#,reverse=True)
#print(dic2)
#[(32, 1), (12, 1), (63, 2)]

ken = dic2[0][1]
counter = 0
ans = {}

for y,k in dic2:
    if ken == k:
        counter +=1
    else:
        counter = 1
    tmp = str(k).zfill(6) + str(counter).zfill(6)
    ans[y] = tmp

for i in dic.keys():
    print(ans[i])

Fixed submission:
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input(): return sys.stdin.readline().rstrip()
 
def main():
    N,M=map(int,input().split())
    city=[[] for _ in range(N)]
    s=set()
    for i in range(M):
        P,Y=map(lambda x:int(x)-1,input().split())
        s.add(P)
        city[P].append((Y,i))
    city=list(map(sorted,city))
    ans=[0]*M
    for x in s:
        for i,c in enumerate(city[x]):
            ans[c[1]]=str(x+1).zfill(6)+str(i+1).zfill(6)
    for i in range(M):
        print(ans[i])
main()
Buggy python submission (verdict: Runtime Error):
a,b = int(input())
if a*b%2==0:
  print("No")
else:
  print("Yes")


Fixed submission:
a,b = map(int,input().split())
if a*b%2==0:
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Runtime Error):
n = input()
if n%2==0:
  k,g = n/2,n//2 + 1
else:
  k,g = n//2,n/2 +1
print(k*g)

Fixed submission:
n = int(input())
if n%2==0:
  k,g = n/2,n/2
else:
  k,g = n//2,n//2+1
print(int(k*g))
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())

x = c − a
y = d - b
print(c-y,d+x,a-y,b+x)

Fixed submission:
a,b,c,d = map(int,input().split())

x = c - a
y = d - b
print(c-y,d+x,a-y,b+x)
Buggy python submission (verdict: Runtime Error):
n = int(input())

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr
ans = 0
for val in range(n):
	if len(factorization(val)) == 8:
      ans +=1
print(ans)

Fixed submission:
n = int(input()) + 1
ans = 0


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)

    # divisors.sort()
    return divisors

for val in range(n):
    if len(make_divisors(val)) == 8 and val%2 != 0:
        ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
for f in range(100//4+1):
	for s in range(100//7+1):
    	ans = f*4 + s*7
        if ans == n:
        	print("Yes")
			exit()
print("No")

Fixed submission:
n = int(input())
for f in range(100//4+1):
	for s in range(100//7+1):
		ans = f*4 + s*7
		if ans == n:
			print("Yes")
			exit()
print("No")
Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

n = int(input())
a_L = list(map(int,input().split()))
c = lcm(*a_L) -1

#print(c)
ans = 0
for val in a_L:
    ans += c%val
print(ans)


Fixed submission:

import fractions

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

ans = a[0]
for i in range(1, n):
    ans = ans * a[i] // fractions.gcd(ans, a[i])

c = ans -1

#print(c)
ans = 0
for val in a:
    ans += c%val
print(ans)
Buggy python submission (verdict: Runtime Error):
n1 = input()
n = list(n1)
ans = 0
for i in n1:
  ans += 1
if n%ans ==0:
  print("Yes")
else:
  print("No")

Fixed submission:
n=int(input())
n_=[int(i) for i in str(n)]
s=sum(n_)
if n%s==0:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
n1 = input()
n = list(n1)
ans = 0
for i in n:
  ans += 1
if n1%ans ==0:
  print("Yes")
else:
  print("No")

Fixed submission:
n=int(input())
n_=[int(i) for i in str(n)]
s=sum(n_)
if n%s==0:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
n1 = input()
n = list(n1)
ans = 0
for i in n:
  ans += 1
if n%ans ==0:
  print("Yes")
else:
  print("No")

Fixed submission:
n=int(input())
n_=[int(i) for i in str(n)]
s=sum(n_)
if n%s==0:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
n = list(input())
ans = 0
for i in n:
  ans += 1
if ans%n ==0:
  print("Yes")
else:
  print("No")

Fixed submission:
n=int(input())
n_=[int(i) for i in str(n)]
s=sum(n_)
if n%s==0:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
print(max(a+b,a-b,a*b)

Fixed submission:
a,b = map(int,input().split())
print(max(a+b,a-b,a*b))
Buggy python submission (verdict: Runtime Error):
x = int(input())
ans = 0
for a in range(2,x):
  for b in range(2,x):
    if a**b <= x:
        ans = max(ans,a**b)
        #print(a,b)
print(ans)

Fixed submission:
a,b,c,d = map(int,input().split())

if abs(a-c) <= d:
  print("Yes")
elif abs(a-b) <= d and abs(c-b) <= d:
  print("Yes")
else:
  print("No")

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

if abs(a-c) =< d:
  print("Yes")
elif abs(a-b) =< d and abs(c-b) =< d:
  print("Yes")
else:
  print("No")

Fixed submission:
a,b,c,d = map(int,input().split())

if abs(a-c) <= d:
  print("Yes")
elif abs(a-b) <= d and abs(c-b) <= d:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
x = int(input())
ans = 0
for a in range(1,1000):
  for b in range(1,1000):
    if a**b <= 1000:
      ans = max(ans,a**b)
print(ans)

Fixed submission:
x = int(input())
ans = 0
for a in range(2,x):
  for b in range(2,10):
    if a**b <= x:
        ans = max(ans,a**b)
        #print(a,b)
if x == 1:
    print(1)
    exit()
print(ans)
Buggy python submission (verdict: Runtime Error):
x = list(input())
print(700+x.count(o)*100)

Fixed submission:
x = list(input())
print(700+x.count("o")*100)
Buggy python submission (verdict: Runtime Error):
#n = int(input())
#a,b = map(int,input().split())
#a_L = list(map(int,input().split()))
a_L = []
for _ in range(4):
    a_L.append(int(input()))
print(min(a_L[0]+a_L[1])+min(a_L[2]+a_L[3]))

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
print(min(a,b)+min(c,d))
Buggy python submission (verdict: Runtime Error):
 int(input())
print(n // 3)

Fixed submission:
n = int(input())
print(n // 3)
Buggy python submission (verdict: Runtime Error):
_ = input()
a_L = list(map(int,input().split()))

if len(set(a_L)) == 3:
    print("Three")
else:
    print("Four")

Fixed submission:
_ = input()
a_L = list(map(str,input().split()))

if len(set(a_L)) == 3:
    print("Three")
else:
    print("Four")
Buggy python submission (verdict: Runtime Error):
n = int(input())
L = list(map(int,input().split()))
L = soterd(L,reverse=True)
a,b = 0,0
for i in range(len(L)):
  if i%2 == 0:
    a += L[i]
  else:
    b += L[i]
print(a-b)

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

c_L.sort(reverse=True)

alice,bob = 0,0

for val in range(len(c_L)):
    if val %2==0:
        alice += c_L[val]
    else:
        bob += c_L[val]
print(alice-bob)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a*b % == 0:
  print("Even")
else:
  print("Odd")

Fixed submission:
a,b=map(int,input().split())
print("Even" if a*b%2==0 else "Odd")
Buggy python submission (verdict: Runtime Error):
n,y=map(int,input().split())
for i in range(n+1):
  for j in range(n-i+1):
    if 10000*i+5000*j+1000*(n-i-j)==y:
        print(i,j,n-i-j);exit()
print(-1,-1,-1)


Fixed submission:
s = [val for val in input()]
s[3] = "8"
print("".join(s))
Buggy python submission (verdict: Runtime Error):
for i in range(n+1):
  for j in range(n-i+1):
    if 10000*i+5000*j+1000*(n-i-j)==y:
        print(i,j,n-i-j);exit()
print(-1,-1,-1)


Fixed submission:
n,y=map(int,input().split())
for i in range(n+1):
  for j in range(n-i+1):
    if 10000*i+5000*j+1000*(n-i-j)==y:
        print(i,j,n-i-j)
        exit()
print(-1,-1,-1)

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

for m in range(0,n):
    for g in range(0,n):
            s = n-m-g
            if s < 0:
                s = 0
            yen = 10000*m + 5000*g + s*1000
            if int(yen) == int(y):
                print("{0} {1} {2}".format(m,g,s))
                sys.exit()

print("-1 -1 -1")


Fixed submission:
n,y=map(int,input().split())
for i in range(n+1):
  for j in range(n-i+1):
    if 10000*i+5000*j+1000*(n-i-j)==y:
        print(i,j,n-i-j)
        exit()
print(-1,-1,-1)
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())

 if a+b > c+d:
   print("Left")
 elif a+b == c+d:
   print("Balanced")
 else:
   print("Right")

Fixed submission:
a,b,c,d = map(int,input().split())

if a+b > c+d:
    print("Left")
elif a+b == c+d:
    print("Balanced")
else:
    print("Right")
Buggy python submission (verdict: Runtime Error):
s = list(input())
print(s.count("1")

Fixed submission:
s = input()
counter = 0
for val in s:
    if val=='1':
        counter +=1
print(counter)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a_L = list(map(int,input().split()))
 
ans = 0
while True:
  for i in range(a_L):
    if a_L[i]%2 != 0:
      print(ans)
      exit()
    a_L[i] = a_L[i]%2
  ans += 1

Fixed submission:
import sys

n = int(input())
a_L = list(map(int,input().split()))
counter = 0


while True:
    for val in a_L:
        if val % 2 != 0:
            print(counter)
            sys.exit(0)
    counter +=1
    a_L = [i/2 for i in a_L]

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

ans = 0
while True:
  for i in a_L:
    if i%2 != 0:
      print(ans)
      exit()
  ans += 1

    

Fixed submission:
import sys

n = int(input())
a_L = list(map(int,input().split()))
counter = 0


while True:
    for val in a_L:
        if val % 2 != 0:
            print(counter)
            sys.exit(0)
    counter +=1
    a_L = [i/2 for i in a_L]
Buggy python submission (verdict: Runtime Error):
n = list(input())
#a,b = map(int,input().split())
#a_L = list(map(int,input().split()))

fx = sum(n)

if int(n)%fx == 0:
    print("Yes")
else:
    print("No")

Fixed submission:

n= input()
x = map(int,list(n))
#a,b = map(int,input().split())
#a_L = list(map(int,input().split()))
#print(n)
fx = sum(x)

if int(n)%fx == 0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n = list(input())
for i in list(set(n)):
	c = n.count(i)
    if c>=3:
      print("Yes")
      exit()
print("No")

Fixed submission:
n = list(input())

a = list(set(n))

if len(a) > 2:
    print("No")
    exit()

if len(set(n[1:])) == 1 or len(set(n[:3])) == 1 or len(a) == 1:
    print("Yes")
    exit()

print("No")
Buggy python submission (verdict: Runtime Error):
x,t = map(int,input().splist())
print(max(0,x-t))

Fixed submission:
x,t = map(int,input().split())
print(max(0,x-t))

Buggy python submission (verdict: Runtime Error):
x,t = map(int,input().splist())
print(max(0,x-t)

Fixed submission:
x,t = map(int,input().split())
print(max(0,x-t))
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input())

print((a-1)*(b-1))

Fixed submission:
a,b = map(int,input().split())
 
print((a-1)*(b-1))
Buggy python submission (verdict: Runtime Error):
s = list(input())
ans = s[0] + len(s)-2 + s[-1]
print(ans)

Fixed submission:
s = list(input())
ans = s[0] + str(len(s)-2) + s[-1]
print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np
from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson
from scipy.sparse import csr_matrix


n,m = map(int,input().split())

a_L,b_L = [],[]

for i in range(n):
    a,b = map(int,input().split())
    a_L.append(a)
    b_L.append(b)


Fixed submission:

n,m = map(int,input().split())

s_L = []

for i in range(m):
    L = list(map(int,input().split()))
    a = min(L)
    b = max(L)

    if a == 1:
        s_L.append(b)
    elif b == n:
        s_L.append(a)

#print(s_L)
if len(set(s_L)) == len(s_L):
    print("IMPOSSIBLE")
else:
    print("POSSIBLE")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a_L = list(map(int,input().split()))

x,y = 0,0
#a_L = list(sorted(a_L))
ans = float("inf")
g = sum(a_L)
for i in range(1,len(a_L)):
    x = sum(a_L[0:i])
    g = sum(a_L[i:])
    ans = min(abs(x-g),ans)

print(ans)

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

def get_ruisekiwa(a_L):
    # 累積和
    return [0] + list(itertools.accumulate(a_L))

ans = float("inf")
r = get_ruisekiwa(a_L)

#print(r)
for i in range(1,len(a_L)):
    x = r[i]
    g = r[-1] - r[i]
    ans = min(abs(x-g),ans)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a_L = list(map(int,input().split()))

b_L = []
for i in range(n):
    b_L.append(a_L[i])
    b_L = list(reversed(b_L))

print(*b_L)

Fixed submission:
from collections import deque

n = int(input())
a_L = list(map(int,input().split()))

ans = deque()

if n %2 == 0:
    for i in range(0,n):
        if i %2 != 0:
            ans.appendleft(a_L[i])
        else:
            ans.append(a_L[i])
else:
    for i in range(0,n):
        if i %2 == 0:
            ans.appendleft(a_L[i])
        else:
            ans.append(a_L[i])

print(*ans)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())

MOD = 10**9+7
def kaijo(i):
    ans = 1
    for i in range(1,i+1):
        ans *= i%MOD
    return ans

if abs(m-n) == 1:
    ans = kaijo(n) * kaijo(m)
elif n == m:
    ans = 2*kaijo(n) * kaijo(m)


print(ans)

Fixed submission:
n,m = map(int,input().split())
import math

if abs(m-n) == 1:
    ans = math.factorial(n) * math.factorial(m)
elif n == m:
    ans = 2*math.factorial(n) * math.factorial(m)
else:
    ans = 0

mod = 10**9+7
print(ans%mod)

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


def kaijo(i):
    ans = 1
    for i in range(1,i+1):
        ans *= i
    return ans

if abs(m-n) == 1:
    ans = kaijo(n) * kaijo(m)
elif n == m:
    ans = 2*kaijo(n) * kaijo(m)

mod = 10**9+7
print(ans%mod)

Fixed submission:
n,m = map(int,input().split())
import math

if abs(m-n) == 1:
    ans = math.factorial(n) * math.factorial(m)
elif n == m:
    ans = 2*math.factorial(n) * math.factorial(m)
else:
    ans = 0

mod = 10**9+7
print(ans%mod)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if 2*b = a+c:
  print("YES")
else:
  print("NO")

Fixed submission:
a,b,c = map(int,input().split())
if 2*b == a+c:
  print("YES")
else:
  print("NO")

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

n = int(input())
s = []
for _ in range(n):
    s.append(input())

az = string.ascii_lowercase
counts = {}
 
for v in az:

    counts[v] = float("inf")
    for i in range(n):
        counts[v] = min(counts[v], s[i].count(v))
 

ans = ""
for k, v in sorted(counts.items()):
    ans += k*v
print(ans)

Fixed submission:
a,b,c = map(int,input().split())
if 2*b == a+c:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
s1 = list(input())
s2 = list(input())

ans = ""
for i,j in s1,s2:
  ans += i+j
print(ans)

Fixed submission:
s1 = list(input())
s2 = list(input())
n = len(s1)
ans = ""
for i in range(n):
  try:
  	ans += s1[i]+s2[i]
  except:
    ans += s1[i]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
mod = 10**9 + 7

n = int(input())
ans = 1
for i in range(1,n+1):
    ans = ans * i

print(ans%mod)

Fixed submission:
mod = 10**9 + 7

n = int(input())
ans = 1
for i in range(1,n+1):
    ans = ans * i % mod

print(ans)
Buggy python submission (verdict: Runtime Error):
s＝input（）
ans＝0
c＝0
for i in range（3）:
  if s[i]＝＝'R':
    ans+＝1
  else:
    c＝max（ans,c）
    ans＝0
print（c）
    

Fixed submission:
S=input()
ans=0
c=0
for i in range(3):
  if S[i]=="R":
    ans+=1
  else:
    c=max(ans,c)
    ans=0
print(max(c,ans))
Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
score=list(map(int,input().split()))
for i in range(N-K):
  pre=1
  af=1
  for t in range(K):
    pre*=score[t+i]
    af*=score[t+1+i]
  if pre<af:
    print("Yes")
  else:
    print("No")


Fixed submission:
N,K=map(int,input().split())
score=list(map(int,input().split()))
for i in range(N-K):
  if score[i]<score[K+i]:
    print("Yes")
  else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import itertools as it
n,m,k=list(map(int,input().split()))
S=[list(str(input())) for h in range(m)]
ans=0
for i in it.product([0,1],repeat=n):
  for j in it.product(range(2),repeat=m):
    count=0
    for h in range(n):
      for c in range(m):
        if S[h][c]=="#" and i[h]+j[c]==0:
          count+=1
    if count==k:
      ans+=1
print(ans)

Fixed submission:
import itertools as it
H,W,N=map(int,input().split())
c=[list(input()) for t in range(H)]
ans=0
for con in it.product(range(2),repeat=H):
  for row in it.product(range(2),repeat=W):
    count=0
    for h in range(H):
      for w in range(W):
        if c[h][w]=='#' and con[h]==1 and row[w]==1 :
          count+=1
    if count==N:
      ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
print(N+N**2+N***3)

Fixed submission:
N = int(input())
print(N+N**2+N**3)
Buggy python submission (verdict: Time Limit Exceeded):
N,M,V = list(map(int,input().split()))
A=list(map(int,input().split()))
B=list(map(int,input().split()))
S=list(map(int,A+B))
ans=0
time=0
if sum(S)<=V:
  print(N+M)
  exit()
K=sorted(S)
for i in range(N+M):
  if K[0]+time<=V:
    time+=K[0]
    K.pop(0)
    ans+=1
  else:
    print(ans)
    exit()

Fixed submission:
a,b,money=list(map(int,input().split()))
A=[0]+list(map(int,input().split()))
B=[0]+list(map(int,input().split()))
for i in range(1,a+1):
  A[i]+=A[i-1]
for j in range(1,b+1):
  B[j]+=B[j-1]
ans=0
b_cnt=b
for a_cnt in range(a+1):
  if A[a_cnt]>money:
    continue
  while A[a_cnt]+B[b_cnt]>money:
    b_cnt-=1
  ans=max(ans,a_cnt+b_cnt)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N,M,V = list(map(int,input().split()))
A=list(map(int,input().split()))
B=list(map(int,input().split()))
S=list(map(int,A+B))
ans=0
time=0
if sum(S)<=V:
  print(N+M)
  exit()
K=sorted(S)
for i in range(N+M):
  if K[0]+time>V:
    print(ans)
    exit()
  else:
    time+=K[0]
    K.pop(0)
    ans+=1

Fixed submission:
a,b,money=list(map(int,input().split()))
A=[0]+list(map(int,input().split()))
B=[0]+list(map(int,input().split()))
for i in range(1,a+1):
  A[i]+=A[i-1]
for j in range(1,b+1):
  B[j]+=B[j-1]
ans=0
b_cnt=b
for a_cnt in range(a+1):
  if A[a_cnt]>money:
    continue
  while A[a_cnt]+B[b_cnt]>money:
    b_cnt-=1
  ans=max(ans,a_cnt+b_cnt)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N,M,V = list(map(int,input().split()))
A=list(map(int,input().split()))
B=list(map(int,input().split()))
S=list(map(int,A+B))
ans=0
time=0
K=sorted(S)
for i in range(N+M):
  if K[0]+time>V:
    print(ans)
    exit()
  elif i==N+M-1:
    print(N+M)
  else:
    time+=K[0]
    K.pop(0)
    ans+=1

Fixed submission:
a,b,money=list(map(int,input().split()))
A=[0]+list(map(int,input().split()))
B=[0]+list(map(int,input().split()))
for i in range(1,a+1):
  A[i]+=A[i-1]
for j in range(1,b+1):
  B[j]+=B[j-1]
ans=0
b_cnt=b
for a_cnt in range(a+1):
  if A[a_cnt]>money:
    continue
  while A[a_cnt]+B[b_cnt]>money:
    b_cnt-=1
  ans=max(ans,a_cnt+b_cnt)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N,M,V = list(map(int,input().split()))
A=list(map(int,input().split()))
B=list(map(int,input().split()))
S=list(map(int,A+B))
ans=0
time=0
K=sorted(S)
for i in range(N+M):
  if K[0]+time>V:
    print(ans)
    exit()
  elif i==N+M-1:
    print(N+M)
  else:
    time+=K[0]
    K.pop(0)
    ans+=1

Fixed submission:
a,b,money=list(map(int,input().split()))
A=[0]+list(map(int,input().split()))
B=[0]+list(map(int,input().split()))
for i in range(1,a+1):
  A[i]+=A[i-1]
for j in range(1,b+1):
  B[j]+=B[j-1]
ans=0
b_cnt=b
for a_cnt in range(a+1):
  if A[a_cnt]>money:
    continue
  while A[a_cnt]+B[b_cnt]>money:
    b_cnt-=1
  ans=max(ans,a_cnt+b_cnt)
print(ans)
Buggy python submission (verdict: Runtime Error):
S=input()
if S=="ABC":
  print("ARC")
else:
  print("ABC)

Fixed submission:
S=input()
if S=="ABC":
  print("ARC")
else:
  print("ABC")
Buggy python submission (verdict: Runtime Error):
N,M=list(map(int,input().split()))
    si=[0]*N
    ans=0
    for i in range(M):
        S=int(input())
        who=list(map(int(input())))
        for k in range(S):
            si[who[k]]+=1
    for h in range(N):
        if si[h]==0:
          ans+=1
print(ans)

Fixed submission:
N,M=list(map(int,input().split()))
si=[0]*N
ans=0
for i in range(M):
    S=int(input())
    who=list(map(int,input().split()))
    for k in range(S):
        si[who[k]-1]+=1
for h in range(N):
  if si[h]==0:
    ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())
  total=0
  for i in range (1,N+1):
if i%3!=0 and i%5=0
  total+=i
  print(total)

Fixed submission:
N = int(input())
total = 0
for i in range(1, N+1):
    if i % 3 != 0 and i % 5 != 0:
        total += i
print(total)

Buggy python submission (verdict: Runtime Error):
N=int(input())
  total=0
  for i in range (1,N+1):
if i%3!=0 and i%5=0
  total+i
  print(total)

Fixed submission:
N = int(input())
total = 0
for i in range(1, N+1):
    if i % 3 != 0 and i % 5 != 0:
        total += i
print(total)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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

while True:
  if abs(N)>abs(N-K):
    N-=K
  else:
    print(abs(N))
    exit()


Fixed submission:
n, k = map(int, input().split())
ans1 = n%k
ans2 = -(ans1-k)

print(min(ans1, ans2))

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
while True:
  if abs(N)>abs(N-K):
    N-=K
  else:
    print(abs(N))
    exit()

Fixed submission:
n, k = map(int, input().split())
ans1 = n%k
ans2 = -(ans1-k)

print(min(ans1, ans2))
Buggy python submission (verdict: Runtime Error):
N=input()
if N[2]==N[3]: and N[4]==N[5]:
  print("Yes")
else:
  print("No")


Fixed submission:
N=input()
if N[2]==N[3] and N[4]==N[5]:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
N=input()
for i in range(6):
  if N[i]==N[i+1]:
    print("Yes")
    exit()
  else:
    print("No")

Fixed submission:
N=input()
if N[2]==N[3] and N[4]==N[5]:
  print("Yes")
else:
  print("No")