Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
key = input()
s = []
for i in key:
  if i == '0' or if i == '1':
    s.append(i)
  else:
    if len(s) > 0:
      s.pop(-1)
print(s)


Fixed submission:
key = input()
s = []
for i in key:
  if i == '0' or i == '1':
    s.append(i)
  else:
    if len(s) > 0:
      s.pop(-1)
print(''.join(s))

Buggy python submission (verdict: Runtime Error):
key = input()
s = []
for i in key:
  if i == '0' or i == '1':
    s.append(i)
  else:
    len(s) > 0:
      s.pop(-1)
print(s)


Fixed submission:
key = input()
s = []
for i in key:
  if i == '0' or i == '1':
    s.append(i)
  else:
    if len(s) > 0:
      s.pop(-1)
print(''.join(s))

Buggy python submission (verdict: Runtime Error):
key = input()
s = []
for i in key:
  if i == '0' or if i == '1':
    s.append(i)
  else:
    len(s) > 0:
      s.pop(-1)
print(s)


Fixed submission:
key = input()
s = []
for i in key:
  if i == '0' or i == '1':
    s.append(i)
  else:
    if len(s) > 0:
      s.pop(-1)
print(''.join(s))
Buggy python submission (verdict: Runtime Error):
array = list(map(int, input().solit()))
array.sort()
if array == [5, 5, 7]:
  print('YES')
else:
  print('NO')

Fixed submission:
array = list(map(int, input().split()))
array.sort()
if array == [5, 5, 7]:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
# coding: utf-8

N = int(input())
nums = [int(x) for x in input().split()]

if set([num% 2 for num in nums]) == {0}:
    print("Yes")
    exit(1)

a,b,c = 0,0,0
for elem in nums:
    if elem % 4 == 0 : a += 1  # 4の倍数
    else:
        b += 1  # 4の倍数じゃない

# あとづけ 
# 2の倍数かつnot４の倍数についても考える必要がある
c = 0
for elem in nums:
        if elem % 2 == 0 and elem % 4 != 0: c += 1

if N % 2 == 1:  # 奇数
    if b-c <= (N-c+1)/2 : print("Yes")
    else: print("No")
else:  # 偶数
    if b-c <= a : print("Yes")
    else: print("No")

Fixed submission:
# coding: utf-8

N = int(input())
nums = [int(x) for x in input().split()]

if set([num% 2 for num in nums]) == {0}:
    print("Yes")
    exit(0)

a,b,c = 0,0,0
for elem in nums:
    if elem % 4 == 0 : a += 1  # 4の倍数
    else:
        b += 1  # 4の倍数じゃない

# あとづけ 
# 2の倍数かつnot４の倍数についても考える必要がある
c = 0
for elem in nums:
        if elem % 2 == 0 and elem % 4 != 0: c += 1

if N % 2 == 1:  # 奇数
    if b-c <= (N-c+1)/2 : print("Yes")
    else: print("No")
else:  # 偶数
    if b-c <= a : print("Yes")
    else: print("No")
Buggy python submission (verdict: Runtime Error):
def decrease(A,N):
    t = 0
    while(1):
        if max(A) <= N -1: break
        else:
            for i in range(N): A[i] = A[i] + 1
            i = A.index(max(A))
            A[i] = A[i] - N - 1
            t += 1
    return t


if __name__ == '__main__':
    K = int(input())
    p,q = K // 50, K % 50
    A = [i for i in range(50)]
    A = [a + p for a in A]
    for i in range(q):
        A = [a - 1 for a in A]
        A[i] += N + 1

    print(len(A))
    A = [str(a) for a in A]
    print(" ".join(A))

Fixed submission:
def decrease(A,N):
    t = 0
    while(1):
        if max(A) <= N -1: break
        else:
            for i in range(N): A[i] = A[i] + 1
            i = A.index(max(A))
            A[i] = A[i] - N - 1
            t += 1
    return t


if __name__ == '__main__':
    K = int(input())
    p,q = K // 50, K % 50
    A = [i for i in range(50)]
    N = 50
    A = [a + p for a in A]
    for i in range(q):
        A = [a - 1 for a in A]
        A[i] += N + 1

    print(len(A))
    A = [str(a) for a in A]
    print(" ".join(A))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = [x for x in input().split()]
B = []

if n % 2 == 0:
    for i in range(n):
        if i % 2 == 0:
            B.append(A[i])
        else:
            B.insert(0,A[i])
else:
    for i in range(n):
        if i % 2 == 0:
            B.insert(0,A[i])
        else:
            B.append(A[i])
print(" ".join(B))

Fixed submission:
# coding: utf-8
# Here your code !
from collections import deque

n = int(input())
A = [x for x in input().split()]
B = deque()
 
if n % 2 == 0:
    for i in range(n):
        if i % 2 == 0:
            B.append(A[i])
        else:
            B.appendleft(A[i])
else:
    for i in range(n):
        if i % 2 == 0:
            B.appendleft(A[i])
        else:
            B.append(A[i])
print(" ".join(B))
Buggy python submission (verdict: Runtime Error):
nums = [int(x) for x in input().split()]
N = nums[0]
K = nums[1]
arr = []
for i in range(N):
	nums = [int(x) for x in input().split()]
	arr.append(tuple(nums))

arr = sorted(arr, key=lambda x: x[0])

vol = 0
for i in range(len(arr)):
	vol = vol + arr[i][1]
	if vol >= K:
		print(arr[i][0])
		break


Fixed submission:
nums = [int(x) for x in input().split()]

if nums[0] <= nums[2] <= nums[1]:
	print('Yes')
else:
	print('No')
Buggy python submission (verdict: Time Limit Exceeded):
nums = [int(x) for x in input().split()]
N = nums[0]
K = nums[1]
arr = []
for i in range(N):
	nums = [int(x) for x in input().split()]
	for j in range(nums[1]):
		arr.append(nums[0])
arr.sort()
print(arr[K-1])

Fixed submission:
nums = [int(x) for x in input().split()]
N = nums[0]
K = nums[1]
arr = []
for i in range(N):
	nums = [int(x) for x in input().split()]
	arr.append(tuple(nums))

arr = sorted(arr, key=lambda x: x[0])

vol = 0
for i in range(len(arr)):
	vol = vol + arr[i][1]
	if vol >= K:
		print(arr[i][0])
		break
Buggy python submission (verdict: Runtime Error):
import math

N = int(input())

def enum(N,A):
	if(N % A == 0):
		B = N // A
		return (A,B)
	else:
		return 'NULL'

def F(tupleX):
	t = max(tupleX)
	return int(math.log10(t) + 1)

X = []  # 候補
for n in range(1,N):
	X.append(enum(N,n))

Y = [] 
for x in X:
    if (x == 'NULL'):
        continue
    else:
	    y = F(x)
	    Y.append(y)
	
print(min(Y))

Fixed submission:
import math

N = int(input())

def enum(N,A):
    if(N % A == 0):
        B = N // A
        return (A,B)
    else:
        return 'NULL'

def F(tupleX):
    t = max(tupleX)
    return int(math.log10(t) + 1)

X = []
hu = int(math.sqrt(N)) + 1
for n in range(1,hu):
    X.append(enum(N,n))

Y = []
for x in X:
    if (x == 'NULL'):
        continue
    else:
        y = F(x)
        Y.append(y)

print(min(Y))

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

N = int(input())

def solve(N,A):
	if(N % A == 0):
		B = N / A
		return int(math.log10(max(A,B)) + 1)
	else:
		return -1
		

ans = []
for A in range(1,N):
	ans.append(solve(N,A))
print(max(ans))

Fixed submission:
import math

N = int(input())

def enum(N,A):
    if(N % A == 0):
        B = N // A
        return (A,B)
    else:
        return 'NULL'

def F(tupleX):
    t = max(tupleX)
    return int(math.log10(t) + 1)

X = []
hu = int(math.sqrt(N)) + 1
for n in range(1,hu):
    X.append(enum(N,n))

Y = []
for x in X:
    if (x == 'NULL'):
        continue
    else:
        y = F(x)
        Y.append(y)

print(min(Y))
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!

if __name__ == '__main__':
    nums = [int(x) for x in input().split()]
    N,T = nums[0],nums[1]
    cities = [int(x) for x in input().split()]

    profs = {}
    for i in range(len(cities)):
        h = i + cities[i:].index(max(cities[i:]))
        #print("highest",i,h)
        profs[(i,h)] = T * (cities[h] - cities[i])

    maxProf = max(profs.values())
    ans = 0
    for v in profs.values():
        if v == maxProf:
            ans += 1
    print(ans)

Fixed submission:
from collections import defaultdict

if __name__ == '__main__':
    nums = [int(x) for x in input().split()]
    N,T = nums[0],nums[1]
    cities = [int(x) for x in input().split()]

    d = defaultdict(int)

    minPrice = 90000000000
    maxProf = -1
    for city in cities:
        minPrice = min(city, minPrice)
        prof = city - minPrice
        d[prof] += 1
        
        maxProf = max(prof,maxProf)
    print(d[maxProf])
Buggy python submission (verdict: Runtime Error):
N = int(input())
t = [float(x) for x in input().rsplit()]
v = [float(x) for x in input().rsplit()]
t_0 = 0
t_now=0
v_0 = 0
v_now = 0
x = 0
t_end = sum(t)
for i in range(N-1):
    if t[i] > v[i] - v_now:
        x += (1 / 2) * (v[i] - v_now) ** 2
        v_now = v[i]
        x += v[i] * (t[i] - (v[i] - v_now))
    else :
        x+=t[i]*t[i]*(1/2)+v_now*t[i]
        v_now+=t[i]
    t_now +=t[i] 
x +=  (1 / 2) *(t_end-t_now) ** 2
print(x)

Fixed submission:
r = input()
g = input()
print(int(g)*2-int(r))
Buggy python submission (verdict: Runtime Error):
n = int(input())
k = int(input())
num = 2**n
list = [format(str(i),"b").zfill(n) for i in range(num)]
result = []
for i in list:
    a = 1
    for j in len(i):
        if i[j] == "0":
            a *= 2
        else:
            a += k
    result.apppend(a)
print(max(result))

Fixed submission:
n = int(input())
k = int(input())
a = 1
for i in range(n):
    if 2*a>=a+k:
        a = a+k
    else:
        a = 2*a
print(a)

Buggy python submission (verdict: Runtime Error):
    n = int(input())
k = int(input())
num = 2**n
list = [format(i,"b").zfill(n) for i in range(num)]
result = []
for i in list:
    a = 1
    for j in range(len(i)):
        if i[j] == "0":
            a *= 2
        else:
            a += k
    result.append(a)
print(min(result))

Fixed submission:
n = int(input())
k = int(input())
a = 1
for i in range(n):
    if 2*a>=a+k:
        a = a+k
    else:
        a = 2*a
print(a)
Buggy python submission (verdict: Runtime Error):
r, a = map(int, input().split())
print(2*a-r)

Fixed submission:
r = int(input())
a = int(input())
print(a*2-r)

Buggy python submission (verdict: Runtime Error):
#r+p = 2*a -> p = 2*a-r
r, a = map(int, input().split())
print(2*a-r)

Fixed submission:
r = int(input())
a = int(input())
print(a*2-r)
Buggy python submission (verdict: Runtime Error):
#get targets
def targets (K):
	ret = [K]
	for r in range(31):
		if ((K >> r) & 1) == 1 :
			tmp = K
			tmp &= (~(1 << r))
			tmp |= (1 << r) - 1
			ret.append(tmp);
	return ret

#input
N, K = map(int, input().split())
items = []
for steps in range(N):
	A, B = map(int, input().slpit())
	items.append([A, B])
#process
targets = targets(K)
answer = 0
for target in targets:
	cur = 0
	for a, b in items:
		if(target | a == target):
			cur += b;
	answer = max(answer, cur)

print(answer)


Fixed submission:
#get targets
def get (K):
	ret = [K]
	for r in range(31):
		if ((K >> r) & 1) == 1 :
			tmp = K
			tmp &= (~(1 << r))
			tmp |= (1 << r) - 1
			ret.append(tmp);
	return ret

#input
N, K = map(int, input().split())
items = []
for steps in range(N):
	A, B = map(int, input().split())
	items.append([A, B])
#process
targets = get(K)
answer = 0
for target in targets:
	cur = 0
	for a, b in items:
		if(target | a == target):
			cur += b;
	answer = max(answer, cur)

print(answer)
Buggy python submission (verdict: Runtime Error):
N = int(input())
p = [int(p_i) for p_i in input().split()]

answer = 0
for i in range(N):
	if p[i] == i+1:
		answer += 1
		p[i+1] = p[i]

print(answer)

Fixed submission:
N = int(input())
p = [int(p_i) for p_i in input().split()]
p.append(0)
answer = 0
for i in range(N):
	if p[i] == i+1:
		answer += 1
		p[i+1] = p[i]

print(answer)
Buggy python submission (verdict: Runtime Error):
R = int(raw_input())
G = int(raw_input())
print(2 * G - R)

Fixed submission:
R = int(raw_input())
G = int(raw_input())
print(2 * G - R)

Buggy python submission (verdict: Runtime Error):
R = int(raw_input())
G = int(raw_input())
print 2 * G - R

Fixed submission:
R = int(raw_input())
G = int(raw_input())
print(2 * G - R)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 整数の入力
R = int(raw_input())
G = int(raw_input())
print (2*G) - R


Fixed submission:
# -*- coding: utf-8 -*-
# 整数の入力
r = int(input())
g = int(input())
print (2 * g - r)

Buggy python submission (verdict: Runtime Error):
print( ( input() + input() ) / 2 )

Fixed submission:
r = input()
g = input()
print( 2*int(g) - int(r) )

Buggy python submission (verdict: Runtime Error):
x = input()
y = input()
print( ( x + y ) / 2 )

Fixed submission:
r = input()
g = input()
print( 2*int(g) - int(r) )
Buggy python submission (verdict: Runtime Error):
a = input()
a.find("9")
if a !== -1:
    print("Yes")
else:
    print("No")

Fixed submission:
a = input()
if a.find("9") != -1:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
ans = 0
N = int(input())
for i in range(N):
  r1, r2 = input().sprit()
  ans += int(r2) - int(r1) + 1
print(ans)

Fixed submission:
ans = 0
for i in range(int(input())):
  r1, r2 = input().split()
  ans += int(r2) - int(r1) + 1
print(ans)

Buggy python submission (verdict: Runtime Error):
ans = 0
N = int(input())
for i in range(N):
  r1, r2 = input().sprit()
  ans += r2 - r1 + 1
print(ans)

Fixed submission:
ans = 0
for i in range(int(input())):
  r1, r2 = input().split()
  ans += int(r2) - int(r1) + 1
print(ans)

Buggy python submission (verdict: Runtime Error):
ans = 0
for i in range(int(input())):
  r1, r2 = input().sprit()
  ans += r2 - r1 + 1
print(ans)

Fixed submission:
ans = 0
for i in range(int(input())):
  r1, r2 = input().split()
  ans += int(r2) - int(r1) + 1
print(ans)
Buggy python submission (verdict: Runtime Error):
R = int(raw_input())
G = int(raw_input())
b = 2*G + R
print(b)

Fixed submission:
R = int(input())
G = int(input())
b = 2*G - R
print(b)

Buggy python submission (verdict: Runtime Error):
if "__name__"=="__main__":
  r = (int) raw_input()
  g = (int) raw_input()
  k = 2*g - r
  print k

Fixed submission:
r = int(raw_input())
g = int(raw_input())
k = 2*g - r
print k

Buggy python submission (verdict: Runtime Error):
r = raw_input()
g = raw_input()
k = 2*g - r
print k

Fixed submission:
r = int(raw_input())
g = int(raw_input())
k = 2*g - r
print k
Buggy python submission (verdict: Runtime Error):
# -*- coding:utf-8 -*-

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

SUM_CARD = sum(a)

i=1

diff_sum = 0
sunuke = sum(a[0:i])
diff_sum = abs(sunuke*2-SUM_CARD)
i+=1

while(i<N):
    sunuke = sum(a[0:i])
    diff_sum_new = abs(sunuke*2-SUM_CARD)
    if diff_sum_new<diff_sum:
        diff_sum = diff_sum_new
    i += 1

print(diff_sum)


Fixed submission:
# -*- coding:utf-8 -*-

A,B = map(int,input().split())

if (A+B)%3 == 0 or A%3==0 or B%3==0:
    print ("Possible")
else:
    print ("Impossible")
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding:utf-8 -*-
import itertools

N,K = map(int,input().split())
l = []*N
l = list(map(int,input().split()))

l_set = list(itertools.combinations(l,K))

max_s = 0
for i in range(len(l_set)):
    l_sum = sum(l_set[i])
    if l_sum>max_s:
        max_s = l_sum

print(max_s)


Fixed submission:
# -*- coding:utf-8 -*-
import itertools
import numpy as np

N,K = map(int,input().split())
l = np.array(list(map(int,input().split())))

ans = 0
for i in range(K):
    max_i = np.argmax(l)
    ans += l[max_i]
    l = np.delete(l,max_i)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding:utf-8 -*-
import itertools

N,K = map(int,input().split())
l = []*N
l = list(map(int,input().split()))

l_set = list(itertools.combinations(l,K))

max_s = 0
for i in range(len(l_set)):
    if sum(l_set[i])>max_s:
        max_s = sum(l_set[i])

print(max_s)


Fixed submission:
# -*- coding:utf-8 -*-
import itertools
import numpy as np

N,K = map(int,input().split())
l = np.array(list(map(int,input().split())))

ans = 0
for i in range(K):
    max_i = np.argmax(l)
    ans += l[max_i]
    l = np.delete(l,max_i)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding:utf-8 -*-

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

SUM_CARD = sum(a)

i=1

diff_sum = 0
sunuke = sum(a[0:i])
diff_sum = abs(sunuke*2-SUM_CARD)
i+=1

while(i<N):
    sunuke = sum(a[0:i])
    diff_sum_new = abs(sunuke*2-SUM_CARD)
    if diff_sum_new<diff_sum:
        diff_sum = diff_sum_new
    i += 1

print(diff_sum)


Fixed submission:
# -*- coding:utf-8 -*-

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

SUM_CARD = sum(a)
i=0

sum_before = a[i]
diff_sum = abs(sum_before*2-SUM_CARD)
i+=1

while(i<N-1):
    sum_before = sum_before + a[i]
    diff_sum_new = abs(sum_before*2-SUM_CARD)
    if diff_sum_new<diff_sum:
        diff_sum = diff_sum_new
    i += 1

print(diff_sum)
Buggy python submission (verdict: Runtime Error):
N=int(input())
a=map(int,input().split())

num=[0,0,0,0,0,0,0,0,0]
counter=0

for i in a:
    if 1<=i and i<=399:
        num[0]+=1
    elif 400 <= i and i <= 799:
        num[1] += 1
    elif 800 <= i and i <= 1199:
        num[2] += 1
    elif 1200 <= i and i <= 1599:
        num[3] += 1
    elif 1600 <= i and i <= 1999:
        num[4] += 1
    elif 2000 <= i and i <= 2399:
        num[5] += 1
    elif 2400 <= i and i <= 2799:
        num[6] += 1
    elif 2800 <= i and i <= 3199:
        num[7] += 1
    elif 3200 <= i:
        num[8] += 1

for i in range(0,8):
    if num[i]!=0:
        counter+=1

if counter==0 and num[8]==0:
    min=0
    max=0

elif counter==0 and num[8]!=0:
    min=1
    max=num[8]

else:
    min=counter
    max=counter+num[8]

#print(num)
print(str(min)+" "+str(max))


Fixed submission:
r,g,b=map(int,input().split())

s=100*r+10*g+b
if s%4==0:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
x,y=map(int, input().split())


a = [0, 1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1]

if a[x] == a[y]:
    print("YES")
else:
    print("NO")
)

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


a = [0, 1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1]

if a[x] == a[y]:
    print("Yes")
else:
    print("No")

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

s=input()

print (str(a+b+c)+" "+s)

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


a = [0, 1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1]

if a[x] == a[y]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
H,W=map(int,input().split())
a=[]
for i in range(H):
    a.append(map(int,input().split()))

for i in range(0,W+2):
    print("#",end="")
print()

for i in a:
    print("#",end="")
    for j in i:
        print(j,end="")
    print("#")

for i in range(0, W+2):
      print("#",end="")
print()

Fixed submission:
H,W=map(int,input().split())
a=[]
for i in range(H):
    a.append(map(str,input().split()))

for i in range(0,W+2):
    print("#",end="")
print()

for i in a:
    print("#",end="")
    for j in i:
        print(j,end="")
    print("#")

for i in range(0, W+2):
      print("#",end="")
print()
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a>b:
    print("GREATER")
elif a<b:
    print("LESS")
else:
    print("EQUAL")


Fixed submission:
a=int(input())
b=int(input())
if a>b:
    print("GREATER")
elif a<b:
    print("LESS")
else:
    print("EQUAL")

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a>b:
    print("GREATER")
elif a<b:
    print("EQUAL")
else:
    print("LESS")
    

Fixed submission:
a=int(input())
b=int(input())
if a>b:
    print("GREATER")
elif a<b:
    print("LESS")
else:
    print("EQUAL")
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys, copy, math, itertools
from copy import *
from collections import deque
import numpy as np
from heapq import *
from bisect import *
import scipy as sp
from scipy.optimize import linprog
from scipy import ceil, ifft
from scipy.fftpack import fft

A, B, C = list( map(int, input().split() ) )

if A==B: print(C)
if B==C: print(A)
if C==A: print(B)

Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np
from numpy import *
from copy import *

A, B, C = list( map(int, input().split() ) )

if A==B: print(C)
if B==C: print(A)
if C==A: print(B)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys, copy, math, itertools
from copy import *
from collections import deque
import numpy as np
from heapq import *
from bisect import *
import scipy as sp
from scipy.optimize import linprog
#from scipy import ceil, ifft
#from scipy.fftpack import fft

A, B, C = list( map(int, input().split() ) )

if A==B: print(C)
if B==C: print(A)
if C==A: print(B)

Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np
from numpy import *
from copy import *

A, B, C = list( map(int, input().split() ) )

if A==B: print(C)
if B==C: print(A)
if C==A: print(B)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys, copy, math, itertools
from copy import *
from collections import deque
import numpy as np
from heapq import *
from bisect import *
import scipy as sp
from scipy.optimize import linprog
from scipy import ceil, ifft
from scipy.fftpack import fft

# 読み込み
a = int( input() )
b, c = list( map(int, input().split() ) )
s = input()

print( str(a+b+c)+" "+s )

# 改行しない print
#print( str(a+b+c)+" "+s, end='' )

Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np
from numpy import *
from copy import *

A, B, C = list( map(int, input().split() ) )

if A==B: print(C)
if B==C: print(A)
if C==A: print(B)
Buggy python submission (verdict: Runtime Error):
n,k=[int(i) for i in input().split()]
l=[int(i) for i in input().split()]
l.sort()
a=0
for i in range(k):
  a+=l[n-1-i]
print(a)

Fixed submission:
l=[int(i) for i in input().split()]
if (l[0]%3)==0 or (l[1]%3)==0 or (l[0]+l[1])%3==0:
  print ("Possible")
else:
  print ("Impossible")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
l = []
for i in range(N):
    a = int(input())
    if a in l:
        l.remove(a)
    else:
        l.append(a)
print(len(l))


Fixed submission:
N = int(input())
d = {}
for i in range(N):
    a = int(input())
    if a in d:
        d[a] = 1 - d[a]
    else:
        d[a] = 1
print(sum(d.values()))
Buggy python submission (verdict: Time Limit Exceeded):
e = []
n, m = map(int, input().split())
for i in range(m):
    e.append(tuple(map(int, input().split())))

r = False
for a, b in filter(lambda t: t[0] == 1, e):
    if list(filter(lambda t: t[0] == b and t[1] == n, e)):
        r = True
        break
if r:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")


Fixed submission:
n, m = map(int, input().split())
s = [False] * n
g = [False] * n
for i in range(m):
    a, b = map(int, input().split())
    if a == 1:
        s[b] = True
    if b == n:
        g[a] = True

ans = "IMPOSSIBLE"
for i in range(n):
    if s[i] and g[i]:
        ans = "POSSIBLE"
        break
print(ans)
Buggy python submission (verdict: Runtime Error):
xs = map(int, raw_input().split())

if xs[2] >= xs[0] and xs[2] <= xs[1]:
    print "Yes"
else:
    print "No"


Fixed submission:
xs = [int(x) for x in input().split()]

if xs[2] >= xs[0] and xs[2] <= xs[1]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
if input[0]==input[1]:
  print(input[2])

Fixed submission:
a, b, c = (int(i) for i in input().split())

if a==b:
  print(c)
elif b==c:
  print(a)
elif c==a:
  print(b)
else:
  pass