Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
x,y,z=map(int,input().split())
print("{} {} {}".format(z,x,y)

Fixed submission:
x,y,z=map(int,input().split())
print("{} {} {}".format(z,x,y))
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(4100000)

x,y,a,b,c = map(int,input(),split())
p = sort(list(map(int,input(),split())))
q = sort(list(map(int,input(),split())))
r = list(map(int,input(),split()))
ans = 0

for k in range(1,x+1):
    r.append(p[-k])
for v in range(1,y+1):
    r.append(p[-v])

rs = sort(r)

for i in range(1,X+Y+1):
    ans += rs[-i]
print(str(ans))

Fixed submission:
import sys
sys.setrecursionlimit(4100000)

x,y,a,b,c = map(int,input().split())
p = sorted(list(map(int,input().split())))
q = sorted(list(map(int,input().split())))
r = list(map(int,input().split()))
ans = 0

for k in range(1,x+1):
    r.append(p[-k])
for v in range(1,y+1):
    r.append(q[-v])

rs = sorted(r)

for i in range(1,x+y+1):
    ans += rs[-i]
print(str(ans))

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

for k in range(1,x+1):
    r.append(p[-k])
for v in range(1,y+1):
    r.append(p[-v])

rs = sort(r)

for i in range(1,X+Y+1):
    ans += rs[-i]
print(str(ans))

Fixed submission:
import sys
sys.setrecursionlimit(4100000)

x,y,a,b,c = map(int,input().split())
p = sorted(list(map(int,input().split())))
q = sorted(list(map(int,input().split())))
r = list(map(int,input().split()))
ans = 0

for k in range(1,x+1):
    r.append(p[-k])
for v in range(1,y+1):
    r.append(q[-v])

rs = sorted(r)

for i in range(1,x+y+1):
    ans += rs[-i]
print(str(ans))
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(2147483647)

n,m = map(int,input().split())
a = n - 1
b = m - 1
ans = 0

if m <= 1:
    ans = n*a/2
else:
    ans = n*a/2 + m*b/2

print(str(int(ans))

Fixed submission:
import sys
sys.setrecursionlimit(2147483647)

n,m = map(int,input().split())
a = n - 1
b = m - 1
ans = 0

if m <= 1:
    ans = n*a/2
else:
    ans = n*a/2 + m*b/2

print(str(int(ans)))
Buggy python submission (verdict: Runtime Error):
import itertools
N,M,Q=map(int,input().split())
L=[]
for q in range(Q):
    L.append(list(map(int,input().split())))

A = itertools.combinations([q for q in range(1,(M+1))], N)
count=[]
for a in A:
    tmp=0
    for l in L:
        if a[l[1]-1] - a[l[0]-1] == l[2]:
            tmp+=l[3]
        else:
            pass
    count.append(tmp)

print(max(count))


Fixed submission:
import itertools
N,M,Q=map(int,input().split())
L=[]
for q in range(Q):
    L.append(list(map(int,input().split())))

A = itertools.combinations_with_replacement([q for q in range(1,(M+1))], N)
count=[]
for a in A:
    tmp=0
    for l in L:
        
        if a[l[1]-1] - a[l[0]-1] == l[2]:
            tmp+=l[3]
    count.append(tmp)

print(max(count))

Buggy python submission (verdict: Runtime Error):
import itertools
N,M,Q=map(int,input().split())
L=[]
for q in range(Q):
    L.append(list(map(int,input().split())))

A = itertools.combinations([q for q in range(1,(M+1))], N)
# print(L)
# print(A)
count=[]
for a in A:
    tmp=[]
    for l in L:
        try:
            if a[l[1]-1] - a[l[0]-1] == l[2]:
                tmp.append(l[3])
            else:
                pass
        except:
            pass
    # print(tmp)
    count.append(sum(tmp))

# print(count)

print(max(count))


Fixed submission:
import itertools
N,M,Q=map(int,input().split())
L=[]
for q in range(Q):
    L.append(list(map(int,input().split())))

A = itertools.combinations_with_replacement([q for q in range(1,(M+1))], N)
count=[]
for a in A:
    tmp=0
    for l in L:
        
        if a[l[1]-1] - a[l[0]-1] == l[2]:
            tmp+=l[3]
    count.append(tmp)

print(max(count))

Buggy python submission (verdict: Runtime Error):
import itertools
N,M,Q=map(int,input().split())
L=[]
for q in range(Q):
    L.append(list(map(int,input().split())))

A = list(itertools.combinations([q for q in range(1,(M+1))], N))
# print(L)
# print(A)
count=[]
for a in A:
    # tmp=0
    tmp=[]
    for l in L:
        if a[l[1]-1] - a[l[0]-1] == l[2]:
            tmp.append(l[3])
        else:
            pass
    # print(tmp)
    count.append(sum(tmp))

# print(count)

print(max(count))


Fixed submission:
import itertools
N,M,Q=map(int,input().split())
L=[]
for q in range(Q):
    L.append(list(map(int,input().split())))

A = itertools.combinations_with_replacement([q for q in range(1,(M+1))], N)
count=[]
for a in A:
    tmp=0
    for l in L:
        
        if a[l[1]-1] - a[l[0]-1] == l[2]:
            tmp+=l[3]
    count.append(tmp)

print(max(count))
Buggy python submission (verdict: Time Limit Exceeded):
from math import floor
A,B,N=map(int,input().split())

x=N
result=[]
maxr=0
for x in reversed(range(1,N+1)):
    xb=x/B
    r=0 if xb < 1 else A*floor(xb)
    l=floor(A*xb)
    ans=l-r
    # print(xb,l,r,ans)
    result.append(ans)
    if len(result) == 1:
        maxr = ans 
    if len(result) > 1 and max(result) == maxr:
        pass

print(max(result))


Fixed submission:
from math import floor
A,B,N=map(int,input().split())

x=min(B-1,N)

print(floor(A*x/B)-A*floor(x/B))

Buggy python submission (verdict: Time Limit Exceeded):
from math import floor
A,B,N=map(int,input().split())

x=N
result=[]
maxr=0
for x in reversed(range(1,N+1)):
    r=0 if x<B else A*floor(x/B)
    ans=floor(A*x/B)-r
    result.append(ans)
    if len(result) == 1:
        maxr = ans 
    if len(result) > 1 and max(result) == maxr:
        pass

print(max(result))


Fixed submission:
from math import floor
A,B,N=map(int,input().split())

x=min(B-1,N)

print(floor(A*x/B)-A*floor(x/B))

Buggy python submission (verdict: Time Limit Exceeded):
from math import floor
A,B,N=map(int,input().split())

x=N
result=[]
maxr=0
for x in reversed(range(1,N+1)):
    ans=floor(A*x/B)-A*floor(x/B)
    result.append(ans)
    if len(result) == 1:
        maxr = ans 
    if len(result) > 1 and max(result) == maxr:
        pass

print(max(result))


Fixed submission:
from math import floor
A,B,N=map(int,input().split())

x=min(B-1,N)

print(floor(A*x/B)-A*floor(x/B))

Buggy python submission (verdict: Runtime Error):
from math import floor
A,B,N=map(int,input().split())

x=N
result=[]
for x in reversed(range(1,N+1)):
    ans=floor(A*x/B)-A*floor(x/B)
    result.append(ans)
    if len(result) == 1:
        maxr = ans 
    if len(result) > 1 max(result) == maxr:
        pass

print(max(result))


Fixed submission:
from math import floor
A,B,N=map(int,input().split())

x=min(B-1,N)

print(floor(A*x/B)-A*floor(x/B))
Buggy python submission (verdict: Runtime Error):
K,N=map(int,input().split())
A=list(map(int,input().split()))

max = K-A[-1]+A[0]
for i in range(N-1):
    if last < A[i+1]-A[i]:
        max = A[i+1]-A[i]

print(K-max)

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

max = K-A[-1]+A[0]
for i in range(N-1):
    if max < A[i+1]-A[i]:
        max = A[i+1]-A[i]

print(K-max)
Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
H=list(map(int,input().split()))
if K >= N:
    print(0)
else:
    for _ in range(K):
        H.pop(H.index(max(H)))
    print(sum(H))

Fixed submission:
N,K=map(int,input().split())
H=list(map(int,input().split()))
H.sort(reverse=True)
if K >= N:
    print(0)
else:
    print(sum(H[K:]))
Buggy python submission (verdict: Runtime Error):
from sympy import nextprime,isprime
X=int(input())
print(X if isprime(X) else nextprime(X))

Fixed submission:
import math

X=int(input())

def isprime(n):
    if n == 2:
        return True
    if n % 2 == 0:
        return False
    m = int(math.sqrt(n)) +1
    for p in range(3, m, 2): 
        if n % p == 0:
            return False
    return True

def nextprime(n):
    if n < 2:
        return 2
    if n < 7:
        return {2: 3, 3: 5, 4: 5, 5: 7, 6: 7}[n]
    nn = 6*(n//6)
    if nn == n:
        n += 1
        if isprime(n):
            return n
        n += 4
    elif n - nn == 5:
        n += 2
        if isprime(n):
            return n
        n += 4
    else:
        n = nn + 5
    while 1:
        if isprime(n):
            return n
        n += 2
        if isprime(n):
            return n
        n += 4

print(X if isprime(X) else nextprime(X))

Buggy python submission (verdict: Runtime Error):
from sympy import nextprime
X=int(input())
print(nextprime(X))

Fixed submission:
import math

X=int(input())

def isprime(n):
    if n == 2:
        return True
    if n % 2 == 0:
        return False
    m = int(math.sqrt(n)) +1
    for p in range(3, m, 2): 
        if n % p == 0:
            return False
    return True

def nextprime(n):
    if n < 2:
        return 2
    if n < 7:
        return {2: 3, 3: 5, 4: 5, 5: 7, 6: 7}[n]
    nn = 6*(n//6)
    if nn == n:
        n += 1
        if isprime(n):
            return n
        n += 4
    elif n - nn == 5:
        n += 2
        if isprime(n):
            return n
        n += 4
    else:
        n = nn + 5
    while 1:
        if isprime(n):
            return n
        n += 2
        if isprime(n):
            return n
        n += 4

print(X if isprime(X) else nextprime(X))
Buggy python submission (verdict: Time Limit Exceeded):
import copy,numpy
n=int(input())
A=[int(input()) for _ in range(n)]
for i,_ in enumerate(A):
    B=copy.copy(A)
    del B[i]
    print(numpy.max(B))

Fixed submission:
n=int(input())
A=[int(input()) for _ in range(n)]
ma=max(A)
ma_i=A.index(ma)
for i in range(n):
    if i==ma_i:
        print(max(A[:i]+A[i+1:]))
    else:
        print(ma)

Buggy python submission (verdict: Time Limit Exceeded):
import copy,numpy
n=int(input())
A=[int(input()) for _ in range(n)]
for i in range(len(A)):
    B=copy.copy(A)
    del B[i]
    print(numpy.max(B))

Fixed submission:
n=int(input())
A=[int(input()) for _ in range(n)]
ma=max(A)
ma_i=A.index(ma)
for i in range(n):
    if i==ma_i:
        print(max(A[:i]+A[i+1:]))
    else:
        print(ma)

Buggy python submission (verdict: Time Limit Exceeded):
import copy
n=int(input())
A=[int(input()) for _ in range(n)]
for i in range(len(A)):
    B=copy.copy(A)
    del B[i]
    print(max(B))

Fixed submission:
n=int(input())
A=[int(input()) for _ in range(n)]
ma=max(A)
ma_i=A.index(ma)
for i in range(n):
    if i==ma_i:
        print(max(A[:i]+A[i+1:]))
    else:
        print(ma)
Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
S=[list(map(int,input().split()))[1:] for _ in range(M)]
P=list(map(int,input().split()))
a=0
for n in range(2**N):
    s_count=0
    for j,s in enumerate(S):
        count=0
        for t in s:
            if n &(1<<t):
               count|=1<<t
        s_count^=count
        if bin(s_count).count("1")%2!=P[j]:
            break
        else:
            a+=1
print(a)

Fixed submission:
a,p=map(int,input().split())
print((a*3+p)//2)
Buggy python submission (verdict: Runtime Error):
if __name__ == ‘__main__’:
  inputs=[int(line) for line in input().split(' ')]
  age,b=inputs[0],inputs[1]
  if age<6:
    print(0)
  elif age<13:
    print(b/2)
  else:
    print(b)

Fixed submission:
age,b = map(int,input().split())	
if age<6:
  print(0)
elif age<13:
  print(b//2)
else:
  print(b)
Buggy python submission (verdict: Runtime Error):
import math

def finddigit(n, b):
    dig = (math.floor(math.log(n)/math.log(b))+1)
    print(dig)

finddigit(n,b)


Fixed submission:
import math

def finddigit(n, b):
    dig = (math.floor(math.log(n)/math.log(b))+1)
    print(dig)

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

res = 0
r = round(sum(x)/len(x))
for i in x:
    res +=(i-p)**2
print(res)

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

res = 0

r = round(sum(x)/len(x))
for i in x:
    res += (i-r)**2
print(res)
Buggy python submission (verdict: Runtime Error):
N = int(input())
ans = dict()
for _ in range(N):
    k = str(input())
    if k in ans:
        ans[k]+=1
    else:
        ans.update({k:1})
groupedByValue = defaultdict(list)
for key, value in sorted(ans.items()):
    groupedByValue[value].append(key)
l = groupedByValue[max(groupedByValue)]
for i in l:
    print(i)

Fixed submission:
from collections import defaultdict
from collections import OrderedDict
N = int(input())
ans = dict()
for _ in range(N):
    k = str(input())
    if k in ans:
        ans[k]+=1
    else:
        ans.update({k:1})
groupedByValue = defaultdict(list)
for key, value in sorted(ans.items()):
    groupedByValue[value].append(key)
l = groupedByValue[max(groupedByValue)]
for i in l:
    print(i)
Buggy python submission (verdict: Runtime Error):
s, t = input().split()
n1, n2 = int(input()).split()
i = input()
if(i==s):
  return n1=n1-1
elif(i==t)
  return n2=n2-1
print(n1,n2)

Fixed submission:
S, T = input().split()
A ,B = input().split()
U = str(input())
if(U == S):
   A = int(A) - 1
elif(U==T):
    B = int(B) -1
print(A,B)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if(a==b):
    print("Yes")
print("No")

Fixed submission:
a,b = input().split()
a = int(a)
b = int(b)
if(a==b):
    print("Yes")
else:
	print("No")

Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
if(a==b):
    print("Yes")
print("No")

Fixed submission:
a,b = input().split()
a = int(a)
b = int(b)
if(a==b):
    print("Yes")
else:
	print("No")
Buggy python submission (verdict: Runtime Error):
the_string = raw_input()
S, T = the_string.split()
print(T.strip()+S.strip())



Fixed submission:
the_string = raw_input()
S, T = the_string.split()
print(T.strip()+S.strip())

Buggy python submission (verdict: Runtime Error):
the_string = raw_input()
name, age = the_string.split()
print(age+name)

Fixed submission:
the_string = raw_input()
S, T = the_string.split()
print(T.strip()+S.strip())

Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
print(T+S)

Fixed submission:
the_string = raw_input()
S, T = the_string.split()
print(T.strip()+S.strip())
Buggy python submission (verdict: Runtime Error):
a = int(raw_input())
b = int(raw_input())
c = int(raw_input())
for i in range(c):
    if(a!=0):
        a-1
    b-1

Fixed submission:
cookies = [int(x) for x in input().split()]
leftOver = cookies[0] - cookies[2]
takahashi = max(0, leftOver)
print(str(takahashi)+ ' ' + (str(cookies[1]) if takahashi > 0  else str(max(0,cookies[1] - abs(leftOver)))))

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
for i in range(c):
    if(a!=0):
        a-1
    b-1


Fixed submission:
cookies = [int(x) for x in input().split()]
leftOver = cookies[0] - cookies[2]
takahashi = max(0, leftOver)
print(str(takahashi)+ ' ' + (str(cookies[1]) if takahashi > 0  else str(max(0,cookies[1] - abs(leftOver)))))

Buggy python submission (verdict: Runtime Error):
the_string = input()
a,b,c = the_string.split()
for i in range(c):
    while(a!=0):
        a-1
    b-1

Fixed submission:
cookies = [int(x) for x in input().split()]
leftOver = cookies[0] - cookies[2]
takahashi = max(0, leftOver)
print(str(takahashi)+ ' ' + (str(cookies[1]) if takahashi > 0  else str(max(0,cookies[1] - abs(leftOver)))))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
lis = map(int, input().split())
ans = 1
for i in lis:
  ans *= i
if ans > 10**18:
  print(-1)
else:
  print(ans)

Fixed submission:
import sys
n = int(input())
lis = list(map(int, input().split()))
ans = 1
if 0 in lis:
  print(0)
  sys.exit()
for i in lis:
  ans *= i
  
  if ans > 10**18:
    print(-1)
    sys.exit()
print(ans)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
c = map(int, input().split())
if a <= c.sum():
  print('Yes')
else:
  print('No')


Fixed submission:
a, b = map(int, input().split())
c = list(map(int, input().split()))
if a <= sum(c):
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
c = map(int, input().split())
if a <= c.sum():
  print('Yes')
else:"
  print('No')

Fixed submission:
a, b = map(int, input().split())
c = list(map(int, input().split()))
if a <= sum(c):
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
s=input()
if s is 'SUN':
  print(7)
if s is 'MON:
  print(6)
if s is 'TUE':
  print(5)
if s is 'WED:
  print(4)
if s is 'THU':
  print(3)
if s is 'FRI:
  print(2)
if s is 'SAT':
  print(1)

Fixed submission:
s=input()
if s == 'SUN':
  print(7)
if s == 'MON':
  print(6)
if s == 'TUE':
  print(5)
if s == 'WED':
  print(4)
if s == 'THU':
  print(3)
if s == 'FRI':
  print(2)
if s == 'SAT':
  print(1)
Buggy python submission (verdict: Runtime Error):
print(sum(c is d for c, d in input(), input()))

Fixed submission:
s,t=input(),input()
print(sum(c is d for c,d in zip(s,t)))

Buggy python submission (verdict: Runtime Error):
s,t=input(),input()
print(sum(1 if c is d for c,d in zip(s,t)))


Fixed submission:
s,t=input(),input()
print(sum(c is d for c,d in zip(s,t)))

Buggy python submission (verdict: Runtime Error):
s,t=input(),input()
print(sum([1 if c is d for c,d in s,t]))

Fixed submission:
s,t=input(),input()
print(sum(c is d for c,d in zip(s,t)))
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
print('red' if a < 3200 else s)

Fixed submission:
n = int(input())
s = input()
print('red' if n < 3200 else s)
Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = 0
for i in range(n):
  a = int(input())
  ans += 1 / a;
print(1 / ans)

Fixed submission:
n = int(input())
ans = 0
lis = list(map(int, input().split()))
for i in lis:
  ans += 1 / i;
print(1 / ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = 0
dict = {}
for _ in range(n):
    s = sorted(list(input()))
    if dict[s] == NULL:
        dict[s] = 0
    ans += dict[s]
    dict[s] += 1
print(ans)

Fixed submission:
n = int(input())
ans = 0
dict = {}
for _ in range(n):
    s = str(''.join(sorted(list(input()))))
    try:
        ans += dict[s]
        dict[s] += 1
    except:
        dict[s] = 1
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
print(max(0,c-(a-b))

Fixed submission:
a,b,c=map(int, input().split())
print(max(0, c - (a-b)))
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
mx=0
for i in a:
  mx=max(mx, i)
  if mx-i>1:
    print('No')
    return 0
print('Yes')


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
mx=0
for i in a:
  mx=max(mx, i)
  if mx-i>1:
    print('No')
    exit()
print('Yes')

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
mx=0
for i in a:
  mx=max(mx, i)
  if mx-i>1:
    print('No')
    return
print('Yes')

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
mx=0
for i in a:
  mx=max(mx, i)
  if mx-i>1:
    print('No')
    exit()
print('Yes')
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
left=[0]
for i in a:
  left.append(max(left[-1],i))
right=[0]
for i in reversed(a):
  right.append(max(right[-1],i))
right.reverse()
for i in range(n):
  print(max(left[i],right[n-i]))

Fixed submission:
n=int(input())
a=[int(input())for _ in range(n)]
left=[0]
for i in a:
  left.append(max(left[-1],i))
right=[0]
for i in reversed(a):
  right.append(max(right[-1],i))
right.reverse()
for i in range(n):
  print(max(left[i],right[i+1]))

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
left=[0]
for i in a:
  left.append(max(left[-1],i))
right=[0]
for i in reversed(a):
  right.append(max(right[-1],i))
right.reverse()
for i in range(n):
  print(max(left[i],right[i+1]))

Fixed submission:
n=int(input())
a=[int(input())for _ in range(n)]
left=[0]
for i in a:
  left.append(max(left[-1],i))
right=[0]
for i in reversed(a):
  right.append(max(right[-1],i))
right.reverse()
for i in range(n):
  print(max(left[i],right[i+1]))
Buggy python submission (verdict: Runtime Error):
s = input()
print('Bad' if true in [s[i] is s[i + 1] for i in range(3)] else 'Good')

Fixed submission:
s = input()
print('Bad' if True in [s[i] is s[i + 1] for i in range(3)] else 'Good')

Buggy python submission (verdict: Runtime Error):
s = input()
print('Bad' if true in [s[i] is s[i + 1] for i in 3] else 'Good')

Fixed submission:
s = input()
print('Bad' if True in [s[i] is s[i + 1] for i in range(3)] else 'Good')

Buggy python submission (verdict: Runtime Error):
s = input()
print('Bad' if true in [s[i] is s[i + 1] for i in 3] 'Good')

Fixed submission:
s = input()
print('Bad' if True in [s[i] is s[i + 1] for i in range(3)] else 'Good')
Buggy python submission (verdict: Runtime Error):
import math
a,b,c,d=map(int,input().split())
a-=1
l=c//math.gcd(c,d)*d
print(b-a-b//c+a//c-b//d+a//d+b//l-a//l)


Fixed submission:
import fractions as f
a,b,c,d=map(int,input().split())
a-=1
l=c//f.gcd(c,d)*d
print(b-a-b//c+a//c-b//d+a//d+b//l-a//l)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
s = input()
s[k - 1] = s[k - 1].lower()
print(s)

Fixed submission:
n, a = list(map(int, input().split()))
s = input()
print(s[:a - 1] + s[a - 1].lower() + s[a:])
Buggy python submission (verdict: Runtime Error):
a,b=[map(int, input().split()) for _ in range(2)]
print((a[0]-b[0])*(a[1]-b[1]))


Fixed submission:
H, W = list(map(int, input().split()))
h, w = list(map(int, input().split()))
print((H - h)*(W - w))

Buggy python submission (verdict: Runtime Error):
H,W,h,w=[map(int, input().split()) for _ in range(2)]
print((H-h)*(W-w))

Fixed submission:
H, W = list(map(int, input().split()))
h, w = list(map(int, input().split()))
print((H - h)*(W - w))
Buggy python submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
for i in reversed(range(2, min(a, b) + 1)):
  if a%i is 0 and b%i is 0:
    k--
  if k is 0:
    print(i)
    exit()


Fixed submission:
a, b, k = map(int, input().split())
for i in reversed(range(1, min(a, b) + 1)):
  if a%i is 0 and b%i is 0:
    k -= 1
  if k is 0:
    print(i)
    exit()

Buggy python submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
for i in reversed(range(min(a, b) + 1)):
  if a%i is 0 and b%i is 0:
    k--
  if k is 0:
    print(i)
    exit()


Fixed submission:
a, b, k = map(int, input().split())
for i in reversed(range(1, min(a, b) + 1)):
  if a%i is 0 and b%i is 0:
    k -= 1
  if k is 0:
    print(i)
    exit()

Buggy python submission (verdict: Runtime Error):
a, b, k = int(input().split())
for i in reversed(range(min(a, b) + 1)):
  if a%i is 0 and b%i is 0:
    k--
  if k is 0:
    print(i)
    exit()

Fixed submission:
a, b, k = map(int, input().split())
for i in reversed(range(1, min(a, b) + 1)):
  if a%i is 0 and b%i is 0:
    k -= 1
  if k is 0:
    print(i)
    exit()
Buggy python submission (verdict: Runtime Error):
from math import factorial

class UnionFind:
  def __init__(self, n):
    self.par = [-1 for _ in range(n)]
  def root(self, x):
    return x if self.par[x] < 0 else self.root(self.par[x])
  def unite(self, x, y):
    x, y = self.root(x), self.root(y)
    if x != y:
      if self.par[y] < self.par[x]:
        x, y = y, x
      self.par[x] += self.par[y]
      self.par[y] = x
    return x != y
  def find(self, x, y):
    return self.root(x) == self.root(y)
  def size(self, x):
    return -self.par[self.root(x)]

n, m = map(int, input().split())
tree = UnionFind(n)
b = []
for _ in range(m):
  a, c = map(int, input().split())
  b.append([a - 1, c - 1])
b.reverse()
ans = [sum(range(n))]
for i, p in enumerate(b):
  if not tree.find(p[0], p[1]):
    ans.append(ans[-1] - tree.size(p[0])*tree.size(p[1]))
    tree.unite(p[0], p[1])
  elif i != m - 1:
    ans.append(ans[-1])
for i in reversed(ans):
  print(i)

Fixed submission:
s = input()
print(min(s.count('1'), s.count('0'))*2)

Buggy python submission (verdict: Runtime Error):
s = input()
print(min(s.count(1), s.count(0))*2)

Fixed submission:
s = input()
print(min(s.count('1'), s.count('0'))*2)