Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
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)
del p[x:]
del q[y:]
for k in range(c):
    if r[k] > p[x - 1] or r[k] > q[y - 1]:
        if p[x - 1] >= q[y - 1]:
            q[y - 1] = r[k]
        elif p[x - 1] < q[y - 1]:
            p[x - 1] = r[k]
    p.sort(reverse = True)
    q.sort(reverse = True)
print(sum(p) + sum(q))                      


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)
del p[x:]
del q[y:]
t = p + q + r
t.sort(reverse = True)
del t[(x + y):]
print(sum(t))
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
q = int(input())
for i in range(q):
    init = list(input().split())
    if init[0] == '1':
        s = s[::-1]
    else:
        c = init[2]
        if init[1] == '1':
            s = c + s
        else:
            s = s + c
str = ''.join(s)
print(str)


Fixed submission:
s = input()
q = int(input())
a = []
b = []
c = 0
for i in range(q):
    init = list(input().split())
    if init[0] == '1':
        a, b = b, a
        c += 1
    else:
        if init[1] == '1':
            a.append(init[2])
        else:
            b.append(init[2])
if c % 2 == 1:
    s = s[::-1]
print(''.join(a[::-1]) + s + ''.join(b))
Buggy python submission (verdict: Runtime Error):
n = int(input())
numbers = list(map(int, input().split()))
ans = 0
while True:
    index = 1
    for i in range(n):
        if numbers[i] % 2 == 0:
            numbers[i] = numbers[i] / 2
        else:
            index = 0
            break
    if index == 1:
        ans += 1
    else:
        break
print(ans)


Fixed submission:
# 文字列を入力
number = list(input())
# カウントの設置
count = 0
# 各桁の判定
if number[0] == '1':
    count += 1
if number[1] == '1':
    count += 1
if number[2] == '1':
    count += 1
# 出力
print(count)
Buggy python submission (verdict: Runtime Error):
s_init = input()
s_list = list(reversed(s_init))
s = ''.join(s_list)
t = ""
words = ["maerd", "remaerd", 'esare', 'resare']
s_list = list(s)
t_list = list(t)
while s != t:
    t_fixed = t
    if len(s_list) < len(t_list):
        break
    elif t == 'gameover':
        break
    else:
        for word in words:
            if s.startswith(t + word):
                t = t + word
                break
        if t = t_fixed:
            t == 'gameover'
if s == t:
    print('YES')
else:
    print('NO')


Fixed submission:
s_init = input()
s_list = list(reversed(s_init))
s = ''.join(s_list)
t = ""
words = ["maerd", "remaerd", 'esare', 'resare']
s_list = list(s)
t_list = list(t)
while s != t:
    t_fixed = t
    if len(s_list) < len(t_list):
        break
    elif t == 'gameover':
        break
    else:
        for word in words:
            if s.startswith(t + word):
                t = t + word
                break
        if t == t_fixed:
            t = 'gameover'
if s == t:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
n=int(input())
dp=[1 for i in range(n+1)]
dp[0]=dp[1]=dp[2]=0
modd=1e9+7
for i in range(3,n):
    for j in range(3,n-i+1):
        dp[i+j]=(dp[i+j]+dp[i])%modd
print(int(dp[n]))

Fixed submission:
n=int(input())
dp=[1 for i in range(n+2)]
dp[0]=dp[1]=dp[2]=0
modd=1e9+7
for i in range(3,n):
    for j in range(3,n-i+1):
        dp[i+j]=(dp[i+j]+dp[i])%modd
print(int(dp[n]))
Buggy python submission (verdict: Time Limit Exceeded):
def go():
    h, w, m = map(int, input().split(" "))
    r, c = {},{}
    d = []
    r_max,c_max=0,0
    u,v=[],[]
    for i in range(m):
        x, y = map(int, input().split(" "))
        if (x - 1) in r.keys():
            r[x - 1] += 1
        else:
            r[x - 1] = 1
        if r[x - 1] > r_max:
            r_max = r[x - 1]
            u=[x-1]
        elif r[x-1]==r_max:
            u.append(x-1)
        if (y - 1) in c.keys():
            c[y - 1] += 1
        else:
            c[y - 1] = 1
        if c[y - 1] > c_max:
            c_max = c[y - 1]
            v=[y-1]
        elif c[y-1]==c_max:
            v.append((y-1))
        d.append((x-1,y-1))

    if r_max==0:
        print(c_max)
    elif c_max==0:
        print(r_max)
    else:
        s=r_max+c_max-1
        for j in u:
            for k in v:
                if (j,k) not in d:
                    s+=1
                    print(s)
                    return
        print(s)

go()

Fixed submission:
h,w,m= map(int,input().split(" "))
ys, xs=[0 for i in range(h)],[0 for j in range(w)]
ms=set()
for i in range(m):
    y,x= map(lambda x: int(x)-1,input().split(" "))
    ys[y]+=1
    xs[x]+=1
    ms.add((y,x))
y_max,x_max= max(ys),max(xs)
largest_ys, largest_xs=[],[]
for i in range(h):
    if ys[i]==y_max:
        largest_ys.append(i)
for i in range(w):
    if xs[i]==x_max:
        largest_xs.append(i)
ans=y_max+x_max-1
for i in largest_ys:
    for j in largest_xs:
        if (i,j) not in ms:
            print(ans+1)
            exit()
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
def go():
    h, w, m = map(int, input().split(" "))
    r, c = {},{}
    d = []
    r_max,c_max=0,0

    for i in range(m):
        x, y = map(int, input().split(" "))
        if (x - 1) in r.keys():
            r[x - 1] += 1
        else:
            r[x - 1] = 1
        if r[x - 1] > r_max:
            r_max = r[x - 1]
        if (y - 1) in c.keys():
            c[y - 1] += 1
        else:
            c[y - 1] = 1
        if c[y - 1] > c_max:
            c_max = c[y - 1]
        d.append((x-1,y-1))

    if r_max==0:
        print(c_max)
    elif c_max==0:
        print(r_max)
    else:
        u=[]
        for i in c.keys():
            if c[i]==c_max:
                u.append(i)
        s=r_max+c_max-1
        for j in r.keys():
            if r[j]==r_max:
                for k in u:
                    if (j,k) not in d:
                        s+=1
                        print(s)
                        return
        print(s)

go()

Fixed submission:
h,w,m= map(int,input().split(" "))
ys, xs=[0 for i in range(h)],[0 for j in range(w)]
ms=set()
for i in range(m):
    y,x= map(lambda x: int(x)-1,input().split(" "))
    ys[y]+=1
    xs[x]+=1
    ms.add((y,x))
y_max,x_max= max(ys),max(xs)
largest_ys, largest_xs=[],[]
for i in range(h):
    if ys[i]==y_max:
        largest_ys.append(i)
for i in range(w):
    if xs[i]==x_max:
        largest_xs.append(i)
ans=y_max+x_max-1
for i in largest_ys:
    for j in largest_xs:
        if (i,j) not in ms:
            print(ans+1)
            exit()
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=input()
w=s.index('W')
s=s[w:]
a= s.count('W')
b=s[len(s)-a:].count('W')
print(a-b)


Fixed submission:
n=int(input())
s=input()
if s.count('R')==n:
    print(0)
else:
    w=s.index('W')
    s=s[w:]
    a= s.count('W')
    b=s[len(s)-a:].count('W')
    print(a-b)
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(" ")))

for i in range(1, n):
    a[i] += a[i - 1]
for i in range(1, m):
    b[i] += b[i - 1]

j,mx= m-1,0
for i in range(n):
    if a[i]>k:
        break
    while(b[j]>k-a[i]):
        j-=1
    if (i+j+2>mx):
        mx=i+j+2
print(mx)

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

a = [0]+list(map(int, input().split(" ")))
b = [0]+list(map(int, input().split(" ")))

for i in range(1, n+1):
    a[i] += a[i - 1]
for i in range(1, m+1):
    b[i] += b[i - 1]

j,mx= m,0
for i in range(n+1):
    if a[i]>k:
        break
    while(b[j]>k-a[i]):
        j-=1
    if (i+j>mx):
        mx=i+j
print(mx)

Buggy python submission (verdict: Time Limit Exceeded):
def go(s,b):
    count=-1
    for i in b:
        if s>=i:
           count+=1

    return count

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

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

c,d=[],[]
s=0
for i in a:
   s+=i
   c.append(s)
s=0
for i in b:
   s+=i
   d.append(s)

mx=0
for i,j in enumerate(c):
    if j<=k:
        for q,w in enumerate(d):
            if j+w<=k:
                if i+q+2>mx:
                    mx=i+q+2
            else:
                break
        if i+1>mx:
            mx=i+1
    else:
        break
for q,w in enumerate(d):
    if w<=k:
        if q+1>mx:
            mx=1+q
    else:
        break
print(mx)


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

a = [0]+list(map(int, input().split(" ")))
b = [0]+list(map(int, input().split(" ")))

for i in range(1, n+1):
    a[i] += a[i - 1]
for i in range(1, m+1):
    b[i] += b[i - 1]

j,mx= m,0
for i in range(n+1):
    if a[i]>k:
        break
    while(b[j]>k-a[i]):
        j-=1
    if (i+j>mx):
        mx=i+j
print(mx)

Buggy python submission (verdict: Time Limit Exceeded):
def go(s,b):
    count=-1
    for i in b:
        if s>=i:
           count+=1

    return count

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

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

c,d=[],[]
s=0
for i in a:
   s+=i
   c.append(s)
s=0
for i in b:
   s+=i
   d.append(s)

mx=0
for i,j in enumerate(c):
    if j<=k:
        for q,w in enumerate(d):
            if j+w<=k:
                if i+q+2>mx:
                    mx=i+q+2
        if i+1>mx:
            mx=i+1
for q,w in enumerate(d):
    if w<=k:
        if q+1>mx:
            mx=1+q
print(mx)


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

a = [0]+list(map(int, input().split(" ")))
b = [0]+list(map(int, input().split(" ")))

for i in range(1, n+1):
    a[i] += a[i - 1]
for i in range(1, m+1):
    b[i] += b[i - 1]

j,mx= m,0
for i in range(n+1):
    if a[i]>k:
        break
    while(b[j]>k-a[i]):
        j-=1
    if (i+j>mx):
        mx=i+j
print(mx)
Buggy python submission (verdict: Time Limit Exceeded):
import math
n=int(input())
g=0
for i in range(1,n+1):
    j= math.floor(n/i)
    g+= j*(j+1)*i/2
print(int(g))

Fixed submission:

n=int(input())
g=0
for i in range(1,n+1):
    g+= 0.5*i*(n//i)*((n//i)+1)
print(int(g))

Buggy python submission (verdict: Time Limit Exceeded):
count=0
n=int(input())
for i in range(1,n+1):
    for j in range(1,n+1):
        if i%j==0:
            count+=i
print(count)

Fixed submission:

n=int(input())
g=0
for i in range(1,n+1):
    g+= 0.5*i*(n//i)*((n//i)+1)
print(int(g))
Buggy python submission (verdict: Runtime Error):
def bin_search(arr,k):
    low, high = 0, n - 1
    while (low <= high):
        mid= low+(high-low)//2
        if arr[mid]==k:
            return mid
        if arr[mid]>k:
            high=mid-1
        else:
            low=mid+1

x,n= map(int,input().split(' '))
if n!=0:
    arr= list(map(int,input().split(' ')))
    arr.sort()
    idx= bin_search(arr,x)

    l,r=-1,-1
    for i in range(1,idx):
        left= arr[idx-i]
        if x-left>i:
            l=(arr[idx-i+1]-1)
            break
    if l==-1:
        l=arr[0]-1
    for i in range(1,n-idx):
        right= arr[idx+i]
        if right-x>i:
            r=(arr[idx+i-1]+1)
            break
    if r==-1:
        r=arr[n-1]+1
    if (x-l)<=(r-x):
        print(l)
    else:
        print(r)
else:
    print(x)

Fixed submission:
x,n= map(int,input().split(' '))
if n!=0:
    arr= list(map(int,input().split(' ')))
    for j in range(x+1):
        for i in range(-1,2):
            if arr.count(x+i*j)==0:
                print(x+i*j)
                exit(0)
else:
    print(x)
Buggy python submission (verdict: Runtime Error):
    a,b,c,k= map(int,input().split(' '))
    if k<a:
        print(k)
    else:
        k-=a
        if k<b:
            print(a)
        else:
            k-=b
            print(a-k)

Fixed submission:
a,b,c,k= map(int,input().split(' '))
if k<=a:
    print(k)
else:
    if k<=(a+b):
        print(a)
    else:
        print(a+(a+b-k))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=input()


count= n*(n-1)*(n-2)/6

for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            if k-j==j-i:
                count-=1
            else:
                if s[i]==s[j] or s[j]==s[k] or s[i]==s[k]:
                    count-=1
print(int(count))

Fixed submission:
def reduce(arr,n):
    count=len(arr)*(len(arr)-1)*(n-len(arr))/2+len(arr)*(len(arr)-1)*(len(arr)-2)/6
    return count

n=int(input())
s=input()

r,g,b=[],[],[]

for i,j in enumerate(s):
    if j=='R':
        r.append(i)
    elif j=='G':
        g.append(i)
    else:
        b.append(i)

count= n*(n-1)*(n-2)/6
count-=reduce(r,n)
count-=reduce(g,n)
count-=reduce(b,n)

for i in range(n):
    for j in range(i+1,n):
        if j+(j-i)<n:
            if s[i]!=s[j] and s[j]!=s[j+(j-i)] and s[i]!=s[j+(j-i)]:
                count-=1
print(int(count))
Buggy python submission (verdict: Runtime Error):
n=int(input())
if n%2==:
  print(n/2)
else:
  print(int(n/2)+1)  

Fixed submission:
n=int(input())
if n%2==0:
  print(int(n/2))
else:
  print(int((n+1)/2))

Buggy python submission (verdict: Runtime Error):
n=int(input())
if n%2==:
  print(n/2)
else:
	print(n//2+1)  

Fixed submission:
n=int(input())
if n%2==0:
  print(int(n/2))
else:
  print(int((n+1)/2))
Buggy python submission (verdict: Runtime Error):
h, w = map(int, input().split(" "))
dp = [[0 for i in range(w)] for j in range(h)]
for i in range(h):
    s = input()
    for j in range(w):
        if i==0 and j==0:
            dp[0][0]= 1 if (s[j]=='.') else 0
        elif i==0:
            dp[0][j]= dp[0][j-1] if (s[j]=='.') else 0
        elif j==0:
            dp[i][0]= dp[i-1][0] if (s[0]=='.') else 0
        else:
            dp[i][j]= dp[i-1][j]+dp[i][j-1] if s[j]=='.' else 0
mod=1e9+7
print(int(dp[h-1][w-1]%mod))


Fixed submission:
h, w = map(int, input().split(" "))
dp = [[0 for i in range(w)] for j in range(h)]
mod=1e9+7
for i in range(h):
    s = input()
    for j in range(w):
        if i==0 and j==0:
            dp[0][0]= 1 if (s[j]=='.') else 0
        elif i==0:
            dp[0][j]= dp[0][j-1] if (s[j]=='.') else 0
        elif j==0:
            dp[i][0]= dp[i-1][0] if (s[0]=='.') else 0
        else:
            dp[i][j]= (dp[i-1][j]%mod+dp[i][j-1]%mod)%mod if s[j]=='.' else 0
print(int(dp[h-1][w-1]%mod))
Buggy python submission (verdict: Runtime Error):
print(-(int(inpuut())-1))
    

Fixed submission:
x = int(input())
if x ==1:
  print(0)
else:
  print(1)

Buggy python submission (verdict: Runtime Error):
x = int(inpuut())
if x ==1:
  print(0)
else:
  print(1)
    

Fixed submission:
x = int(input())
if x ==1:
  print(0)
else:
  print(1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
if n < 105:
  print(0)
else:
  ans = 0
  for i in range(n,103,-2):
    count = 1
    for j in range(1,99,2):
      nj = n%j
      if nj == 0:
        count += 1
      if count == 9:
        ans -= 1
    if count == 8:
      ans += 1
print(ans)

Fixed submission:
a, b = map(int,input().split())
print((a-1)*(b-1))
Buggy python submission (verdict: Runtime Error):
n = int(input())
if n < 105:
  print(0)
else:
  ans = 0
  for i in range(n,103,-2):
    count = 1
    for j in range(1,99,2):
      nj = n%j
      if nj == 0:
        count += 1
      if count == 9:
        ans -= 1
    if count == 8:
      ans += 1
print(ans)

Fixed submission:
n = int(input())
a = 0
for i in range(1,n+1,2):
  c = 0
  for j in range(1,n+1):
    if i%j == 0:
      c += 1
  if c == 8:
    a +=1
print(a)

Buggy python submission (verdict: Runtime Error):
n = int(input())
if n < 105:
  print(0)
else:
  ans = 0
  for i in range(n,103,-2):
    count = 1
    for j in range(1,101,2):
      nj = n%j
      if nj == 0:
        count += 1
      if count == 9:
        break
    if count == 8:
      ans += 1
print(ans)

Fixed submission:
n = int(input())
a = 0
for i in range(1,n+1,2):
  c = 0
  for j in range(1,n+1):
    if i%j == 0:
      c += 1
  if c == 8:
    a +=1
print(a)

Buggy python submission (verdict: Runtime Error):
n = int(input())
if n < 105:
  print(0)
else:
  ans = 0
  for i in range(n,103,-2):
    count = 1
    for j in range(1,99,2):
      nj = n%j
      if nj == 0:
        count += 1
      if count == 9:
        break
    if count == 8:
      ans += 1
print(ans)

Fixed submission:
n = int(input())
a = 0
for i in range(1,n+1,2):
  c = 0
  for j in range(1,n+1):
    if i%j == 0:
      c += 1
  if c == 8:
    a +=1
print(a)
Buggy python submission (verdict: Runtime Error):
a = list(map(int, input().split()))
a.sort()
k = int(input())
a[2] = a[2]*2**k
print(sum(a))

Fixed submission:
a,b = map(int, input().split())
if a > b:
  print(a-1)
else:
  print(a)
Buggy python submission (verdict: Time Limit Exceeded):
import copy
N = int(input())
X = list(map(int,input().split()))
Y = copy.deepcopy(X)
for i in range(N):
  del Y[i]
  Y.sort()
  print(Y[(N-1)//2])
  Y = copy.deepcopy(X)


Fixed submission:
import copy
N = int(input())
X = list(map(int,input().split()))
XX = copy.deepcopy(X)
XX.sort()
X1 = XX[(N//2)-1]
X2 = XX[N//2]
if X1 == X2:
  for i in range(N):
    print(X1)
else:
  Y = float(X1 + X2)
  Y = Y/2
  for i in range(N):
    if X[i] > Y:
      print(X1)
    else:
      print(X2)
Buggy python submission (verdict: Runtime Error):
import sys

A,B,K = map(int, input().split())
for i in range(A,B+1):
  if i <= A + K-1 or i>= B-K+1:
    print(i)

Fixed submission:
import sys

S = input()
T = "abc"
if len(S) > 3:
  print("No")
else:
  for i in S:
    if i in T:
      T = T.replace(i,'')
    else:
      print("No")
      sys.exit()
  print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
import sys

A,B,K = map(int, input().split())
for i in range(A,B+1):
  if i <= A + K-1 or i>= B-K+1:
    print(i)

Fixed submission:
import sys
P = []
A,B,K = map(int, input().split())

for i in range(A,min(B,A+K)):
  print(i)
  P.append(i)
for i in range(max(A,B-K+1),B+1):
  if i not in P:
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
nowp = 0
cost = []
for i in range(N):
  cost.append(0)
  for j in range(N):
    if i != j:
      cost[i] += abs(nowp - A[j])
      nowp = A[j]
  cost[i] += abs(nowp)
  nowp = 0

for i in range(N):
  print('%d ' %cost[i])

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
nowp = 0
cost = []
allcost = 0
for i in range(N):
  allcost += abs(nowp - A[i])
  nowp = A[i]
allcost += abs(A[-1])

for i in range(N):
  cost.append(allcost)
  if i != 0 and i != N-1:
    cost[i] += abs(A[i-1]-A[i+1]) - abs(A[i-1]-A[i]) - abs(A[i]-A[i+1])
  elif i == 0:
    cost[i] += abs(0-A[i+1]) - abs(0-A[i]) - abs(A[i]-A[i+1])
  else:
    cost[i] -= abs(A[i-1]-A[i]) + abs(A[i]) - abs(A[i-1])
for i in range(N):
  print('%d ' %cost[i])
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
set(a)
ans=[0]*1000000
x=1
for i in a:
    if(ans[i]!=0):
        ans[i]=2
        continue
    for j in range(i,1000000,i):
        ans[j]=ans[j]+1
cnt=0
for i in range(0,n):
    if(ans[a[i]]==1):
        cnt=cnt+1
print(cnt)


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
set(a)
ans=[0]*1000005
x=1
for i in a:
    if(ans[i]!=0):
        ans[i]=2
        continue
    for j in range(i,1000005,i):
        ans[j]=ans[j]+1
cnt=0
for i in range(0,n):
    if(ans[a[i]]==1):
        cnt=cnt+1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
cnt=0
a.sort()
a.reverse()
for i in range(n):
    for j in range(a.index(a[i]),n):
        if(i==j):
            continue
        if(a[i]%a[j]==0):
            cnt=cnt+1
            break
print(n-cnt)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
set(a)
ans=[0]*1000005
x=1
for i in a:
    if(ans[i]!=0):
        ans[i]=2
        continue
    for j in range(i,1000005,i):
        ans[j]=ans[j]+1
cnt=0
for i in range(0,n):
    if(ans[a[i]]==1):
        cnt=cnt+1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
flag=0
cnt=0
for i in range(n):
    for j in range(n):
        if(i==j):
            continue
        if(a[i]%a[j]==0):
            cnt=cnt+1
            break
print(n-cnt)
    

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
set(a)
ans=[0]*1000005
x=1
for i in a:
    if(ans[i]!=0):
        ans[i]=2
        continue
    for j in range(i,1000005,i):
        ans[j]=ans[j]+1
cnt=0
for i in range(0,n):
    if(ans[a[i]]==1):
        cnt=cnt+1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,k=map(int,input().split())
for i in range(k):
    if a>0:
        a=a-1
    elif b>0:
        b=b-1
    else:
        break
print("{0} {1}".format(a,b))

Fixed submission:
a,b,k=map(int,input().split())
k2=0
a2=0
if a>=k:
    k2=a-k
    a=a-k
    print("{0} {1}".format(a,b))
    exit()
else:
    k2=k-a
    a=0
if b>=k2:
    b=b-k2
else:
    b=0
print("{0} {1}".format(a,b))
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().sprit())
if(a+b==3):
  print("3")
elif(a+b==4):
  print("2")
else:
  print("1")


Fixed submission:
a=int(input())
b=int(input())
if(a+b==3):
  print("3")
elif(a+b==4):
  print("2")
else:
  print("1")
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=input()
b=input()
for i in range(n):
    print(a[i],end="")
    print(b[i],end="")
print()
    

Fixed submission:
n=int(input())
a,b=map(str,input().split())
for i in range(n):
    print(a[i],end="")
    print(b[i],end="")
print()
Buggy python submission (verdict: Runtime Error):
import math
x,y=map(int,input().split())
print((x * y) // math.gcd(x, y))

Fixed submission:
import math
a,b=map(int,input().split())
x=a*b
if(a<b):
    a,b=b,a
r=a%b
while(r!=0):
    a=b
    b=r
    r=a%b
print(int(x/b))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[]
b=[]
for i in range(n):
    num=int(input())
    a.append(num)
    b.append(num)
for i in range(n):
    tmp=a[i]
    a[i]=0
    print(max(a))
    a[i]=tmp

Fixed submission:
n=int(input())
a=[]
b=[]
for i in range(n):
    num=int(input())
    a.append(num)
    b.append(num)
b.sort(reverse=True)
x=a.count(b[0])
for i in range(n):
    if(a[i]==b[0]):
        if(x==1):
            print(b[1])
        else:
            print(b[0])
    else:
        print(b[0])