Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
from collections import Counter
N=int(input())
NN=N//2
l=list(map(int,input().split()))
l1=[l[2*i] for i in range(NN)]
l2=[l[2*i+1] for i in range(NN)]
l1c=Counter(l1)
l2c=Counter(l2)
r1=l1c.most_common()
r2=l2c.most_common()
if r1[0][0]==r2[0][0]:
  if r1[0][0]==NN and r2[0][0]==NN:
    ans=NN
  elif r1[0][1]>r2[0][1]:
    ans=N-r1[0][1]-r2[1][1]
  else:
    ans=N-r1[1][1]-r2[0][1]
else:
  ans=N-r1[0][1]-r2[0][1]
print(ans)

Fixed submission:
from collections import Counter
N=int(input())
NN=N//2
l=list(map(int,input().split()))
l1=[l[2*i] for i in range(NN)]
l2=[l[2*i+1] for i in range(NN)]
l1c=Counter(l1)
l2c=Counter(l2)
r1=l1c.most_common()
r2=l2c.most_common()
if r1[0][0]==r2[0][0]:
  if r1[0][1]==NN and r2[0][1]==NN:
    ans=NN
  elif r1[0][1]>r2[0][1]:
    ans=N-r1[0][1]-r2[1][1]
  elif r1[0][1]<r2[0][1]:
    ans=N-r1[1][1]-r2[0][1]
  else:
    if r1[1][1]>r2[1][1]:
      ans=N-r1[1][1]-r2[0][1]
    else:
      ans=N-r1[0][1]-r2[1][1]
else:
  ans=N-r1[0][1]-r2[0][1]
print(ans)
Buggy python submission (verdict: Runtime Error):
H,W=map(int,input().split())
l=[]
for i in range(H):
  l.append(list(map(int,input().split())))
  
x,y=0,0
p=1
J=[]
ans=0
while y<H:
  if y%2==0:
    if x<W-1:
      nx=x+1
      ny=y
    else:
      nx=x
      ny=y+1
  else:
    if x>0:
      nx=x-1
      ny=y
    else:
      nx=x
      ny=y+1
  if l[y][x]%2==1:
    l[ny][nx]+=1
    ans+=1
    J.append((y+1,x+1,ny+1,nx+1))
  x,y=nx,ny
  if x==[0,W-1][H%2] and y==H-1:
    break

print(ans)
for a,b,c,d in J:
  print(a,b,c,d)

Fixed submission:
H,W=map(int,input().split())
l=[]
for i in range(H):
  l.append(list(map(int,input().split())))
  
x,y=0,0
p=1
J=[]
ans=0
if(H,W)==(1,1):
  print(0)
else:
  while y<H:
    if y%2==0:
      if x<W-1:
        nx=x+1
        ny=y
      else:
        nx=x
        ny=y+1
    else:
      if x>0:
        nx=x-1
        ny=y
      else:
        nx=x
        ny=y+1
    if l[y][x]%2==1:
      l[ny][nx]+=1
      ans+=1
      J.append((y+1,x+1,ny+1,nx+1))
    x,y=nx,ny
    if x==[0,W-1][H%2] and y==H-1:
      break

  print(ans)
  for a,b,c,d in J:
    print(a,b,c,d)

Buggy python submission (verdict: Runtime Error):
H,W=map(int,input().split())
l=[]
for i in range(H):
  l.append(list(map(int,input().split())))
  
x,y=0,0
p=1
J=[]
ans=0
while y<H:
  if y%2==0:
    if x<W-1:
      nx=x+1
      ny=y
    else:
      nx=x
      ny=y+1
  else:
    if x>0:
      nx=x-1
      ny=y
    else:
      nx=x
      ny=y+1
  if l[y][x]%2==1:
    l[ny][nx]+=1
    ans+=1
    J.append((x,y,nx,ny))
  x,y=nx,ny
  if x==[0,W-1][H%2] and y==H-1:
    break

print(ans)
for a,b,c,d in J:
  print(a,b,c,d)

Fixed submission:
H,W=map(int,input().split())
l=[]
for i in range(H):
  l.append(list(map(int,input().split())))
  
x,y=0,0
p=1
J=[]
ans=0
if(H,W)==(1,1):
  print(0)
else:
  while y<H:
    if y%2==0:
      if x<W-1:
        nx=x+1
        ny=y
      else:
        nx=x
        ny=y+1
    else:
      if x>0:
        nx=x-1
        ny=y
      else:
        nx=x
        ny=y+1
    if l[y][x]%2==1:
      l[ny][nx]+=1
      ans+=1
      J.append((y+1,x+1,ny+1,nx+1))
    x,y=nx,ny
    if x==[0,W-1][H%2] and y==H-1:
      break

  print(ans)
  for a,b,c,d in J:
    print(a,b,c,d)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
from collections import defaultdict
N,M,Q=map(int,input().split())
d=defaultdict(int)
for i in range(M):
  a,b=map(int,input().split())
  d[(a,b)]+=1
c={}
for x in range(0,N+1):
  for y in range(0,x):
    c[(x,y)]=0
  c[(x,x)]=d[(x,x)]
  for y in range(x+1,N+1):
    c[(x,y)]=c[(x,y-1)]+d[(x,y)]
for i in range(Q):
  x,y=map(int,input().split())
  print(sum(c[(j,y)]-c[(j,x-1)] for j in range(x,y+1)))

Fixed submission:
N,M,Q=map(int,input().split())
c=[[0 for i in range(N+1)] for j in range(N+1)]
for i in range(M):
  a,b=map(int,input().split())
  c[a][b]+=1
for i in range(1,N):
  for j in range(1,N+1-i):
    c[j][i+j]+=c[j+1][i+j]+c[j][i+j-1]-c[j+1][i+j-1]
for i in range(Q):
  a,b=map(int,input().split())
  print(c[a][b])

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
from collections import defaultdict
N,M,Q=map(int,input().split())
d=defaultdict(int)
for i in range(M):
  a,b=map(int,input().split())
  d[(a,b)]+=1
c={}
for x,y in itertools.product(range(0,N+1),repeat=2):
  c[(x,y)]=sum(d[(x,j)] for j in range(1,y+1))
for i in range(Q):
  x,y=map(int,input().split())
  print(sum(c[(j,y)]-c[j,x-1] for j in range(x,y+1)))

Fixed submission:
N,M,Q=map(int,input().split())
c=[[0 for i in range(N+1)] for j in range(N+1)]
for i in range(M):
  a,b=map(int,input().split())
  c[a][b]+=1
for i in range(1,N):
  for j in range(1,N+1-i):
    c[j][i+j]+=c[j+1][i+j]+c[j][i+j-1]-c[j+1][i+j-1]
for i in range(Q):
  a,b=map(int,input().split())
  print(c[a][b])

Buggy python submission (verdict: Time Limit Exceeded):
import bisect
N,M,Q=map(int,input().split())
L=[]
for i in range(M):
  a,b=map(int,input().split())
  L.append([a,b])
L.sort(key=lambda x:x[0])
for i in range(Q):
  x,y=map(int,input().split())
  j=bisect.bisect(L,[x,0])
  ans=0
  for k in range(j,M):
    if L[k][1]<=y:
      ans+=1
  print(ans)

Fixed submission:
N,M,Q=map(int,input().split())
c=[[0 for i in range(N+1)] for j in range(N+1)]
for i in range(M):
  a,b=map(int,input().split())
  c[a][b]+=1
for i in range(1,N):
  for j in range(1,N+1-i):
    c[j][i+j]+=c[j+1][i+j]+c[j][i+j-1]-c[j+1][i+j-1]
for i in range(Q):
  a,b=map(int,input().split())
  print(c[a][b])
Buggy python submission (verdict: Runtime Error):
S=input()
s=abcdefghijklmnopqrstuvwxyz
c=0
if S[0]=="A" and "C" in S[2:len(S-1)]:
  i=S.find("C")
  S=S[1:i]+S[i+1:]
  if S.islower():
    c=1
print("AC" if c==1 else "WA")

Fixed submission:
S=input()
c=0
if S[0]=="A" and "C" in S[2:len(S)-1]:
  i=S.find("C")
  S=S[1:i]+S[i+1:]
  if S.islower():
    c=1
print("AC" if c==1 else "WA")
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=[int(x) for x in input().split()]
ans=0
for i in range(N):
  for j in range(i+1,N):
    ans=max(ans,abs(A[i]-A[j])
print(ans)

Fixed submission:
N=int(input())
A=[int(x) for x in input().split()]
ans=0
for i in range(N):
  for j in range(i+1,N):
    ans=max(ans,abs(A[i]-A[j]))
print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=[int(x) for x in input().split()]
for i in range(N):
  A[i]=A[i]-1-i
b=A[N//2]
c=A[(N//2)+1]
ans1,ans2=0,0
for i in range(N):
  ans1+=abs(A[i]-b)
  ans2+=abs(A[i]-c)
print(min(ans1,ans2))

Fixed submission:
N=int(input())
A=[int(x) for x in input().split()]
for i in range(N):
  A[i]=A[i]-1-i
A.sort()
if N==1:
  print(0)
else:
  b=A[N//2]
  c=A[(N//2)+1]
  ans1,ans2=0,0
  for i in range(N):
    ans1+=abs(A[i]-b)
    ans2+=abs(A[i]-c)
  print(min(ans1,ans2))
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[int(x) for x in input().split()]
sA=[]
for i in range(N):
  b=bin(A[i])
  j=-1
  p=0
  ss=set()
  while b[j]!="b":
    if b[j]=="1":
      ss.add(p)
    p+=1
    j-=1
  sA.append(ss)
st=set()
j=-1
ans=0
for i in range(N):
  while j<N-1:
    if not st&sA[j+1]:
      st|=sA[j+1]
      j+=1
    else:
      break
  g=j-i+1
  ans+=g
  st-=sA[i]
print(ans)

Fixed submission:
N=int(input())
A=[int(x) for x in input().split()]
st=0
j=-1
ans=0
for i in range(N):
  while j<N-1:
    if not st&A[j+1]:
      st|=A[j+1]
      j+=1
    else:
      break
  g=j-i+1
  ans+=g
  st-=A[i]
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[int(x) for x in input().split()]
sA=[]
for i in range(N):
  b=bin(A[i])
  j=-1
  p=0
  ss=set()
  while b[j]!="b":
    if b[j]=="1":
      ss.add(p)
    p+=1
    j-=1
  sA.append(ss)
st=set()
j=-1
ans=0
for i in range(N):
  while j<N-1:
    if not st&sA[j+1]:
      st|=sA[j+1]
      j+=1
    else:
      break
  g=j-i+1
  ans+=g
  st-=sA[i]
print(ans)

Fixed submission:
N=int(input())
A=[int(x) for x in input().split()]
st=0
j=-1
ans=0
for i in range(N):
  while j<N-1:
    if not st&A[j+1]:
      st|=A[j+1]
      j+=1
    else:
      break
  g=j-i+1
  ans+=g
  st-=A[i]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
X=int(input())
i=2
li=1
while X**(1/i)>=2:
  s=int(X**(1/i))
  li=max(li,s**i)
print(li)

Fixed submission:
X=int(input())
ans=1
for i in range(2,10):
  for j in range(2,X):
    if j**i<=X:
      ans=max(ans,j**i)
    else:
      break
print(ans)
Buggy python submission (verdict: Runtime Error):
s=input()
K=int(input())
li=[]
for i in range(len(s)):
  m=min(K,len(s)-i)
  for j in range(m):
    li.append(s[i:i+j+1])
li.sort()
print(li[K])

Fixed submission:
s=input()
K=int(input())
li=[]
for i in range(len(s)):
  m=min(K,len(s)-i)
  for j in range(m):
    li.append(s[i:i+j+1])
li.sort(reverse=True)
st=[]
while len(st)<K:
  t=li.pop()
  if t not in st:
    st.append(t)
print(st[-1])

Buggy python submission (verdict: Runtime Error):
s=input()
K=int(input())
li=[]
for i in range(len(s)):
  m=min(K,len(s)-i-1)
  for j in range(m):
    li.append(s[i:i+j+1])
li.sort()
print(li[K])

Fixed submission:
s=input()
K=int(input())
li=[]
for i in range(len(s)):
  m=min(K,len(s)-i)
  for j in range(m):
    li.append(s[i:i+j+1])
li.sort(reverse=True)
st=[]
while len(st)<K:
  t=li.pop()
  if t not in st:
    st.append(t)
print(st[-1])
Buggy python submission (verdict: Runtime Error):
L=[]
for i in range(3):
  L.append(list(map(int,input().split())))
if all(S[i][0]-S[i+1][0]==S[i][1]-S[i+1][1]==S[i][2]-S[i+1][2] for i in range(2)) and all(S[0][i]-S[0][i+1]==S[1][i]-S[1][i+1]==S[2][i]-S[2][i+1] for i in range(2)):
  print("Yes")
else:
  print("No")

Fixed submission:
L=[]
for i in range(3):
  L.append(list(map(int,input().split())))
if all(L[i][0]-L[i+1][0]==L[i][1]-L[i+1][1]==L[i][2]-L[i+1][2] for i in range(2)) and all(L[0][i]-L[0][i+1]==L[1][i]-L[1][i+1]==L[2][i]-L[2][i+1] for i in range(2)):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
N=input()
t,x,y=0,0,0
s=0
for i in range(N):
  a,b,c=map(int,input().split())
  if a-t!=abs(b-x)+abs(c-y):
    s=1
    break
  t,x,y=a,b,c
print("No" if s else "Yes")

Fixed submission:
N=int(input())
t,x,y=0,0,0
s=0
for i in range(N):
  a,b,c=map(int,input().split())
  p,q=a-t,abs(b-x)+abs(c-y)
  if p<q or p%2!=q%2:
    s=1
    break
  t,x,y=a,b,c
print("No" if s else "Yes")
Buggy python submission (verdict: Runtime Error):
N,H=map(int,input().split())
sl=[]
th=[]
for i in range(N):
  s,t=map(int,input().split())
  sl.append(s)
  th.append(t)

gsl=max(sl)
ans=0
while H>0:
  if gsl<max(th):
    at=max(th)
    H-=at
    ans+=1
    th.remove(at)
  else:
    ans+=H//gsl
    if H%gsl!=0:
      ans+=1
    break
print(ans)

Fixed submission:
N,H=map(int,input().split())
sl=[]
th=[]
for i in range(N):
  s,t=map(int,input().split())
  sl.append(s)
  th.append(t)
th.sort()
gsl=max(sl)
ans=0
while th:
  if gsl<th[-1]:
    at=th.pop(-1)
    H-=at
    ans+=1
    if H<=0:
      break
  else:
    ans+=H//gsl
    if H%gsl!=0:
      ans+=1
    break
else:
  ans+=H//gsl
  if H%gsl!=0:
    ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
import itertools
N,M=map(int,input().split())
edge=[]
for i in range(N+1):
  edge.append([0]*(N+1))
for j in range(N):
  a,b=map(int,input().split())
  edge[a][b]=1
  edge[b][a]=1
roots=list(itertools.permutations(range(2,N+1)))
ans=0
for root in roots:
  pos=1
  for i in range(N-1):
    nxt=root[i]
    if edge[pos][nxt]==1:
      pos=nxt
    else:
      break
  else:
    ans+=1
print(ans)
  

Fixed submission:
import itertools
N,M=map(int,input().split())
edge=[]
for i in range(N+1):
  edge.append([0]*(N+1))
for j in range(M):
  a,b=map(int,input().split())
  edge[a][b]=1
  edge[b][a]=1
roots=list(itertools.permutations(range(2,N+1)))
ans=0
for root in roots:
  pos=1
  for i in range(N-1):
    nxt=root[i]
    if edge[pos][nxt]==1:
      pos=nxt
    else:
      break
  else:
    ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
s = [input() for i in range(N)]
for v in ['AC', 'WA', 'TLE', 'RE']:
  print({0}×{1}.format(v, s.count(v)))

Fixed submission:
N = int(input())
s = [input() for i in range(N)]
for v in ['AC', 'WA', 'TLE', 'RE']:
  print('{0} x {1}'.format(v, s.count(v)))
Buggy python submission (verdict: Runtime Error):
h,w,k=map(int, input().split())
board = [list(input()) for _ in range(h)]
ans=0
for paint_h in range(2**h):
  for paint_w in range(2**w):
    cnt=0
    for i in range(h):
      for j in range(w):
        if (paint_h>>i)&1==0 and (paint_w>>j)&1==0:
          if board[i][j]=='#':
            cnt+=1
    if cnk==l:
      ans += 1
print(ans)

Fixed submission:
h,w,k=map(int, input().split())
board = [list(input()) for _ in range(h)]
ans=0
for paint_h in range(2**h):
  for paint_w in range(2**w):
    cnt=0
    for i in range(h):
      for j in range(w):
        if (paint_h>>i)&1==0 and (paint_w>>j)&1==0:
          if board[i][j]=='#':
            cnt+=1
    if cnt==k:
      ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = map(int, input().split)
print('{:.16g}'.format(1 / sum(x for x in A)))

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
print('{:.16g}'.format(1 / sum(1 / x for x in A)))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split())) 
 
ans = 0

for i in range(0,n,2):
  if a[i] % 2 == 1:         
    ans += 1 
print(ans)

Fixed submission:
L, R, d = map(int, input().split())

count = 0

for i in range(101):
  if d * i >= L and d * i <= R:
    count += 1
  if d * i > R:
    break
    
print(count)
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()))

a, b = [0], [0]
for i in range(N):
  a.append(a[i] + A[i])
  print(a)
for i in range(M):
  b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N + 1):
  if a[i] > K:
    break
  while b[j] > K - a[i]:
    j -= 1
    ans = max(ans, i + j)

print(ans)


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

a, b = [0], [0]
for i in range(N):
  a.append(a[i] + A[i])
for i in range(M):
  b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N + 1):
  if a[i] > K:
    break
  while b[j] > K - a[i]:
    j -= 1
  ans = max(ans, i + j)
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys

x, y = map(int, input().split())

for i in range(x + 1):
  for j in range(x + i):
    if i * 2 + j * 4 == y and i + j == X:
      print('yes')
      sys.exit()
 
print('no')
      

Fixed submission:
x, y = map(int, input().split())
ans = 'No'

for i in range(x + 1):
	j = x - i
	if i * 2 + j * 4 == y:
		ans = 'Yes'
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
An = list(map(int, input().split()))
ans = 1

for i in An:
  ans = ans * i
  if ans > 10 ** 18:
    ans = -1
    continue
if ans < 0:
  print(-1)
else:  
  print(ans)

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

if 0 in An:
  print(0)
  exit(0)

for i in An:
  ans = ans * i
  if ans > 10 ** 18:
    print(-1)
    exit(0)

print(ans)

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

for i in An:
  ans = ans * i

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

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

if 0 in An:
  print(0)
  exit(0)

for i in An:
  ans = ans * i
  if ans > 10 ** 18:
    print(-1)
    exit(0)

print(ans)
Buggy python submission (verdict: Runtime Error):
k = int(input())
a, b = map(int, input().split())
x = 0
  
while True:
  x += k
  
  if a <= x <= b:
    print('OK')
	break
  
  if x > b:
    print('NO')
    break

Fixed submission:
k = int(input())
a, b = map(int, input().split())
x = 0
  
while True:
  x += k
  
  if a <= x <= b:
    print('OK')
    break
  
  if x > b:
    print('NG')
    break
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = [input() for _ in range(n)]
ans = []

for i in s:
  if i not in ans:
    ans.append(i)

print(len(ans))

Fixed submission:
n = int(input())
s = [input() for _ in range(n)]

s_set = set(s)

print(len(s_set))
Buggy python submission (verdict: Runtime Error):
import collections 

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

c = collections.Counter(a)

for i in range(1, n + 1):
  print(c[i])

Fixed submission:
import math

r = int(input())

print(2 * r * math.pi)
Buggy python submission (verdict: Runtime Error):
n = int(input())

ans = 0

for i in range(1, n + 1):
  if i % 3 != 0 ans i % 5 != 0:
    ans += i

print(ans)

Fixed submission:
n = int(input())

ans = 0

for i in range(1, n + 1):
  if i % 3 != 0 and i % 5 != 0:
    ans += i

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

while n > 0:
  if k == 1:
    ans = 0
    break
    
  ans = min(ans, abs(n - k))
  n -= k

print(ans)

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

ans = min(n % k, k - n % k)

print(ans)
Buggy python submission (verdict: Runtime Error):
x, y, a, b, c = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p.sort(reverse = True)
q.sort(reverse = True)
r.sort(reverse = True)

ans = p[:x] + q[:y]

for i in range(x + y):
  if ans[i] < r[0]:
    ans[i] = r[0]
    r.pop(0)

print(sum(ans))

Fixed submission:
x, y, a, b, c = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p.sort(reverse = True)
q.sort(reverse = True)
r.sort(reverse = True)

ans = p[:x] + q[:y] + r
ans.sort(reverse = True)

print(sum(ans[:x + y]))
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
P = list(map(int, input().split()))

ans = 0
P_sum = 0

for i in range(N - K + 1):
  for j in range(K):
    P_sum += P[i + j] + 1
  #print(ans, P_sum)
  ans = max(ans, P_sum)
  P_sum = 0

print(ans / 2)

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

ans = 0
P_sum = 0

for i in range(N):
  P[i] = (P[i] + 1) / 2

for j in range(K):
  P_sum += P[j]

ans = P_sum
for t in range(K, N):
  P_sum -= P[t - K]
  P_sum += P[t]
  ans = max(ans, P_sum)

print(ans)
Buggy python submission (verdict: Runtime Error):
from itertools import permutations

N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))
num_P = 0
num_Q = 0

li = list(permutations(range(1, N + 1)))

#print(P, Q, li)
print(abs(li.index(P) - li.index(Q)))
#print(li)
#print(li.index(P))
#print(li.index(Q))

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

if 500 * K >= X:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
A, B, K = map(int, input().split())

A_after = A - K

if A < K:
  B_after = B - (K - A)
  A_after = 0
  
print(A_after, B_after)

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

A_after = 0
B_after = 0

if A - K >= 0:
  A_after = A - K
  B_after = B

elif A + B - K >= 0:
  B_after = B - (K - A)
  
print(A_after, B_after)
Buggy python submission (verdict: Runtime Error):
A = input().split()
count = 0
for a in range(3):
    if A[a] == 'R':
      count++
      
if count == 2 A[1] == 'S':
      count = 1
print(count)

Fixed submission:
A = input()
count = 0
for a in range(3):
    if A[a] == 'R':
      count+=1
      
if count == 2 and A[1] == 'S':
      count = 1
print(count)

Buggy python submission (verdict: Runtime Error):
A = input().split()
count = 0
for a in range(3)
    if A[a] == 'R':
      count++
      
if count == 2 A[1] == 'S':
      count = 1
print(count)
        

Fixed submission:
A = input()
count = 0
for a in range(3):
    if A[a] == 'R':
      count+=1
      
if count == 2 and A[1] == 'S':
      count = 1
print(count)
Buggy python submission (verdict: Runtime Error):
N = input()
N = int(N[2])
if N == 3:
    print('bon')
elif N in [0,1,6,8]:
    print('pon')
else:
    print('hon')


Fixed submission:
N = input()
N = int(N[-1])
if N == 3:
    print('bon')
elif N in [0,1,6,8]:
    print('pon')
else:
    print('hon')

Buggy python submission (verdict: Runtime Error):
N = input()
N = N[2]
if N == 3:
    print('bon')
elif N in [0,1,6,8]:
    print('pon')
else:
    print('hon')

Fixed submission:
N = input()
N = int(N[-1])
if N == 3:
    print('bon')
elif N in [0,1,6,8]:
    print('pon')
else:
    print('hon')
Buggy python submission (verdict: Runtime Error):
K = int(input())
S = input()
if len(S) <= K:
    print(S)
else:
    print(S[K-1:-1]

Fixed submission:
K = int(input())
S = input()
if len(S) <= K:
    print(S)
else:
    print(S[:K]+'...')
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
if S == T[:-1]:
    return 'Yes'
else:
    return 'No'

Fixed submission:
S = input()
T = input()
if S == T[:-1]:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N,M = map(int, input().split())
x = input()
total_vote = sum(x)
count = 0
for y in x:
    if y >=(total_vote/(4*M)):
        count+=1
      
if count>=M:
    print('Yes')
else:
    print('No')


Fixed submission:
N,M = map(int, input().split())
x = list(map(int, input().split()))
total_vote = sum(x)
count = 0
for y in x:
    if y >=(total_vote/(4*M)):
        count+=1
      
if count>=M:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
N, K = map(abs, (N,K))
amari = N%K
if amari == 0:
    print(0)
else:
    amari2 = K - amari
    print(max(amari, amari2)

Fixed submission:
N, K = map(int, input().split())
N, K = map(abs, (N,K))
amari = N%K
if amari == 0:
    print(0)
else:
    amari2 = K - amari
    print(min(amari, amari2))

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
N, K = map(abs, (N,K))
amari = N%K
if amari == 0:
    print(0)
else:
    amari2 = K - amari
    print(max(amari, amari2)

Fixed submission:
N, K = map(int, input().split())
N, K = map(abs, (N,K))
amari = N%K
if amari == 0:
    print(0)
else:
    amari2 = K - amari
    print(min(amari, amari2))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input().split()]
f = 0
A.sort()
for i in range(len(A)):
    if A[i] == A[i+1]:
        f = 1
        break
        
if f > 0:
    print("NO")
else:
    print("YES")



Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]
f = 0
A.sort()
for i in range(len(A)):
    if i != len(A)-1:
        if A[i] == A[i+1]:
            f = 1
            break
        
if f > 0:
    print("NO")
else:
    print("YES")

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input().split()]
f = 0
A.sort()
for i in range(len(A)):
    # if A.count(i) > 1:
    if A[i] == A[i+1]:
        f = 1
        break
        
if f > 0:
    print("NO")
else:
 print("YES")
    


Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]
f = 0
A.sort()
for i in range(len(A)):
    if i != len(A)-1:
        if A[i] == A[i+1]:
            f = 1
            break
        
if f > 0:
    print("NO")
else:
    print("YES")

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(i) for i in input().split()]
f = 0
for i in A:
    if A.count(i) > 1:
        f = 1 
        
if f > 0:
    print("NO")
else:
 print("YES")
    


Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]
f = 0
A.sort()
for i in range(len(A)):
    if i != len(A)-1:
        if A[i] == A[i+1]:
            f = 1
            break
        
if f > 0:
    print("NO")
else:
    print("YES")