Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = raw_input()
S = map(int, raw_input().split())
q = raw_input()
T = map(int, raw_input().split())

def BinarySearch(list, num):
	#print list
	l = len(list)
	if l == 1 and list[0] != num:
		#print("*0")
		return 0
	else:
		if list[l/2] == num:
			#print("*1")
			return 1
		elif list[l/2] < num:
			#print("*2")
			return BinarySearch(list[l/2+1:], num)
		else:
			#print("*3")
			return BinarySearch(list[:l/2], num)

cnt = 0
for i in T:
	#print("*4")
	#print BinarySearch(S, i)
	cnt += BinarySearch(S, i)
	#print cnt

print cnt

Fixed submission:
n = raw_input()
S = map(int, raw_input().split())
q = raw_input()
T = map(int, raw_input().split())

def BinarySearch(list, num):
	left = 0
	right = len(list) - 1
	while left <= right:
		mid = (left + right) / 2
		#print("left = {:}".format(left))
		#print("mid = {:}".format(mid))
		#print("right = {:}".format(right))
		#print("")
		if list[mid] == num:
			return 1
		elif list[mid] < num:
			left = mid + 1
			#print("left = {:}".format(left))
			#print("mid = {:}".format(mid))
			#print("right = {:}".format(right))
			#print("")
		else:
			right = mid - 1
			#print("left = {:}".format(left))
			#print("mid = {:}".format(mid))
			#print("right = {:}".format(right))
			#print("")
	return 0

cnt = 0
for i in T:
	cnt += BinarySearch(S, i)

print cnt
Buggy python submission (verdict: Runtime Error):
# coding: utf-8

import codecs
import sys

sys.stdout = codecs.getwriter("shift_jis")(sys.stdout) # ??????
sys.stdin = codecs.getreader("shift_jis")(sys.stdin) # ??\???

# ??\??¬?????????print??????????????´?????? print(u'?????????') ??¨??????
# ??\??¬?????????input??? input(u'?????????') ??§OK
# ??°?¢???????????????????????????´??????6,7???????????????????????¢??????

height, width = map(int, raw_input.split(" "))
print("{0} {1}".format(height*width, 2*(height+width)))

Fixed submission:
deglist = raw_input().split(" ")
height = int(deglist[0])
width = int(deglist[1])
menseki = height * width
nagasa = 2 * (height + width)
print menseki, nagasa

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
"""
import codecs
import sys

sys.stdout = codecs.getwriter("shift_jis")(sys.stdout) # ??????
sys.stdin = codecs.getreader("shift_jis")(sys.stdin) # ??\???

# ??\??¬?????????print??????????????´?????? print(u'?????????') ??¨??????
# ??\??¬?????????input??? input(u'?????????') ??§OK
# ??°?¢???????????????????????????´??????6,7???????????????????????¢??????
"""
height, width = map(int, raw_input.split(" "))
print("{0} {1}".format(height*width, 2*(height+width)))

Fixed submission:
deglist = raw_input().split(" ")
height = int(deglist[0])
width = int(deglist[1])
menseki = height * width
nagasa = 2 * (height + width)
print menseki, nagasa

Buggy python submission (verdict: Runtime Error):
height, width = map(int, raw_input.split(" "))
menseki = height * width
nagasa = 2 * (height + width)
print menseki, nagasa

Fixed submission:
deglist = raw_input().split(" ")
height = int(deglist[0])
width = int(deglist[1])
menseki = height * width
nagasa = 2 * (height + width)
print menseki, nagasa

Buggy python submission (verdict: Runtime Error):
deglist = raw_input.split(" ")
height = int(deglist[0])
width = int(deglist[1])
menseki = height * width
nagasa = 2 * (height + width)
print menseki, nagasa

Fixed submission:
deglist = raw_input().split(" ")
height = int(deglist[0])
width = int(deglist[1])
menseki = height * width
nagasa = 2 * (height + width)
print menseki, nagasa
Buggy python submission (verdict: Runtime Error):
deglist = raw_input().split(" ")
W = deglist[0]
H = deglist[1]
x = deglist[2]
y = deglist[3]
r = deglist[4]

if x > r and x < (W - r) and r < y and y < (H - r):
	print "Yes"
else:
	print "No"

Fixed submission:
deglist = raw_input().split(" ")
W = int(deglist[0])
H = int(deglist[1])
x = int(deglist[2])
y = int(deglist[3])
r = int(deglist[4])

if x >= r and x <= (W - r) and r <= y and y <= (H - r):
	print 'Yes'
else:
	print 'No'

Buggy python submission (verdict: Runtime Error):
deglist = raw_input().split(" ")
W = deglist[0]
H = deglist[1]
x = deglist[2]
y = deglist[3]
r = deglist[4]

if x >= r and x <= (W - r) and r <= y and y <= (H - r):
	print 'Yes'
else:
	print 'No'

Fixed submission:
deglist = raw_input().split(" ")
W = int(deglist[0])
H = int(deglist[1])
x = int(deglist[2])
y = int(deglist[3])
r = int(deglist[4])

if x >= r and x <= (W - r) and r <= y and y <= (H - r):
	print 'Yes'
else:
	print 'No'
Buggy python submission (verdict: Runtime Error):
deglist = raw_input().split(" ")
a = int(deglist[0])
b = int(deglist[1])

d = a / b
r = a % b
f = 1.0 * a / b

print("{0} {1} {2.5f}".format(d, r, f))

Fixed submission:
deglist = raw_input().split(" ")
a = int(deglist[0])
b = int(deglist[1])

d = a / b
r = a % b
f = 1.0 * a / b

print("{:} {:} {:.5f}".format(d, r, f))
Buggy python submission (verdict: Runtime Error):
import math

r = int(raw_input())

menseki = r ** 2 * math.pi
shuu = 2 * r * math.pi

print("{:.6f} {:.6f}".format(menseki, shuu))

Fixed submission:
import math

r = float(raw_input())

menseki = r ** 2 * math.pi
shuu = 2 * r * math.pi

print("{:.6f} {:.6f}".format(menseki, shuu))

Buggy python submission (verdict: Runtime Error):
r = int(raw_input())

menseki = r ** 2 * 3.141592
shuu = 2 * r * 3.141592

print("{:.6f} {:.6f}".format(menseki, shuu))

Fixed submission:
import math

r = float(raw_input())

menseki = r ** 2 * math.pi
shuu = 2 * r * math.pi

print("{:.6f} {:.6f}".format(menseki, shuu))
Buggy python submission (verdict: Runtime Error):
data = raw_input().split(" ")
a = int(data[0])
op = data[1]
b = int(data[2])

while True:
	if op = "?":
		break
	elif op == "+":
		ans = a + b
	elif op == "-":
		ans = a - b
	elif op == "*":
		ans = a * b
	else:
		ans = a / b

print ans

Fixed submission:
while True:
	data = raw_input().split(" ")
	a = int(data[0])
	op = data[1]
	b = int(data[2])

	if op == "?":
		break
	elif op == "+":
		ans = a + b
	elif op == "-":
		ans = a - b
	elif op == "*":
		ans = a * b
	else:
		ans = a / b

	print ans

Buggy python submission (verdict: Runtime Error):
while True:
	data = raw_input().split(" ")
	a = int(data[0])
	op = data[1]
	b = int(data[2])

	if op = "?":
		break
	elif op == "+":
		ans = a + b
	elif op == "-":
		ans = a - b
	elif op == "*":
		ans = a * b
	else:
		ans = a / b

	print ans

Fixed submission:
while True:
	data = raw_input().split(" ")
	a = int(data[0])
	op = data[1]
	b = int(data[2])

	if op == "?":
		break
	elif op == "+":
		ans = a + b
	elif op == "-":
		ans = a - b
	elif op == "*":
		ans = a * b
	else:
		ans = a / b

	print ans
Buggy python submission (verdict: Runtime Error):
n = int(raw_input())
data = raw_input().split(" ")

sorted_data = data.sort()

minimum = sorted_data[0]
maximum = sorted_data[-1]

goukei = 0
for i in range(n):
	goukei += i

print("{:} {:} {:}".format(minimum, maximum, goukei))

Fixed submission:
n = int(raw_input())
data = map(int, raw_input().split(" "))

#data = [10, 1, 5, 4, 17]

minimum = data[0]
maximum = data[0]
goukei = 0

for i in data:
	if i < minimum:
		minimum = i

	if i > maximum:
		maximum = i

	goukei += i

print("{:} {:} {:}".format(minimum, maximum, goukei))

Buggy python submission (verdict: Runtime Error):
n = int(raw_input())
data = raw_input().split(" ")

sorted_data = sorted(data)

minimum = sorted_data[0]
maximum = sorted_data[-1]

goukei = 0
for i in data:
	goukei += i

print("{:} {:} {:}".format(minimum, maximum, goukei))

Fixed submission:
n = int(raw_input())
data = map(int, raw_input().split(" "))

#data = [10, 1, 5, 4, 17]

minimum = data[0]
maximum = data[0]
goukei = 0

for i in data:
	if i < minimum:
		minimum = i

	if i > maximum:
		maximum = i

	goukei += i

print("{:} {:} {:}".format(minimum, maximum, goukei))

Buggy python submission (verdict: Runtime Error):
n = int(raw_input())
data = raw_input().split(" ")

minimum = 1000001
maximum = 0
goukei = 0

for i in data:
	if i < minimum:
		minimum = i

	if i > maximum:
		maximum = i

	goukei += i

print("{:} {:} {:}".format(minimum, maximum, goukei))

Fixed submission:
n = int(raw_input())
data = map(int, raw_input().split(" "))

#data = [10, 1, 5, 4, 17]

minimum = data[0]
maximum = data[0]
goukei = 0

for i in data:
	if i < minimum:
		minimum = i

	if i > maximum:
		maximum = i

	goukei += i

print("{:} {:} {:}".format(minimum, maximum, goukei))

Buggy python submission (verdict: Runtime Error):
n = raw_input()
data = raw_input().split(" ")

#data = [10, 1, 5, 4, 17]

minimum = 1000001
maximum = 0
goukei = 0

for i in data:
	if i < minimum:
		minimum = i
	if i > maximum:
		maximum = i
	goukei += i

print("{:} {:} {:}".format(minimum, maximum, goukei))

Fixed submission:
n = int(raw_input())
data = map(int, raw_input().split(" "))

#data = [10, 1, 5, 4, 17]

minimum = data[0]
maximum = data[0]
goukei = 0

for i in data:
	if i < minimum:
		minimum = i

	if i > maximum:
		maximum = i

	goukei += i

print("{:} {:} {:}".format(minimum, maximum, goukei))
Buggy python submission (verdict: Runtime Error):
text = ""
for i in range(1, n+1):
	if i % 3 == 0:
		text += " " + str(i)
	elif:
		while i:
			if i % 10 == 3:
				text += " " + str(i)
			else:
				i /= 10
print text

Fixed submission:
import sys

n = int(raw_input())
#n = 30


for i in range(1, n+1):
	if i % 3 == 0:
		sys.stdout.write(" {:}".format(i))
	elif str(i).find('3') > -1:
		sys.stdout.write(" {:}".format(i))
print("")
Buggy python submission (verdict: Runtime Error):
all_cards = [[],[],[],[]]
for i in range(4):
	for j in range(13):
		all_cards[i].append(j+1)

n = int(raw_input())
for i in range(n):
	card = raw_input().split()
	if card[0] == "S":
		all_cards[0].remove(card[1])
	elif card[0] == "H":
		all_cards[1].remove(card[1])
	elif card[0] == "C":
		all_cards[2].remove(card[1])
	else:
		all_cards[3].remove(card[1])

for i in range(len(all_cards[0])):
	print("S {:}".format(all_cards[0][i]))
for i in range(len(all_cards[1])):
	print("H {:}".format(all_cards[1][i]))
for i in range(len(all_cards[2])):
	print("C {:}".format(all_cards[2][i]))
for i in range(len(all_cards[3])):
	print("D {:}".format(all_cards[3][i]))

Fixed submission:
all_cards = [[],[],[],[]]
for i in range(4):
	for j in range(13):
		all_cards[i].append(j+1)

n = int(raw_input())
for i in range(n):
	card = raw_input().split(" ")
	#print card
	if card[0] == "S":
		all_cards[0].remove(int(card[1]))
	elif card[0] == "H":
		all_cards[1].remove(int(card[1]))
	elif card[0] == "C":
		all_cards[2].remove(int(card[1]))
	else:
		all_cards[3].remove(int(card[1]))

for i in range(len(all_cards[0])):
	print("S {:}".format(all_cards[0][i]))
for i in range(len(all_cards[1])):
	print("H {:}".format(all_cards[1][i]))
for i in range(len(all_cards[2])):
	print("C {:}".format(all_cards[2][i]))
for i in range(len(all_cards[3])):
	print("D {:}".format(all_cards[3][i]))
Buggy python submission (verdict: Runtime Error):
 for i in range(9):
     for i in range(9):
         qq = i * j
         print("qq")

Fixed submission:
for i in range(1,10):
    for j in range(1,10):
        print(str(i)+"x"+str(j)+"="+str(i*j))

Buggy python submission (verdict: Runtime Error):
 for i in range(9):
     for i in range(9):
         qq = i * j
         print("qq")

Fixed submission:
for i in range(1,10):
    for j in range(1,10):
        print(str(i)+"x"+str(j)+"="+str(i*j))

Buggy python submission (verdict: Runtime Error):
 for i in range(9):
     for i in range(9):
         qq = i * j
         print("qq")

Fixed submission:
for i in range(1,10):
    for j in range(1,10):
        print(str(i)+"x"+str(j)+"="+str(i*j))
Buggy python submission (verdict: Runtime Error):
from math import sqrt

def main():

    x1, y1, x2, y2 = map(int, input().split())
    print(sqrt(abs(x2-x1)**2 + abs(y2-y1)**2))


main()

Fixed submission:
from math import sqrt

def main():

    x1, y1, x2, y2 = map(float, input().split())
    print(sqrt(abs(x2-x1)**2 + abs(y2-y1)**2))


main()
Buggy python submission (verdict: Runtime Error):
While True:
    a, op, b = input().split()
    a,b = int(a), int(b)
    op_dict = {'+': (lambda x,y: x + y),
               '-': (lambda x,y: x - y),
               '*': (lambda x,y: x * y),
               '/': (lambda x,y: x // y),
               '?': '?'}
    func = op_dict[op]
    if func != '?': break 
    print('%d' % int(func(a, b)))

Fixed submission:
while True:
    a, op, b = input().split()
    a,b = int(a), int(b)
    op_dict = {'+': (lambda x,y: x + y),
               '-': (lambda x,y: x - y),
               '*': (lambda x,y: x * y),
               '/': (lambda x,y: x // y),
               '?': '?'}
    func = op_dict[op]
    if func == '?': break 
    print('%d' % int(func(a, b)))

Buggy python submission (verdict: Runtime Error):
While True:
    a, op, b = input().split()
    a,b = int(a), int(b)
    op_dict = {'+': (lambda x,y: x + y),
               '-': (lambda x,y: x - y),
               '*': (lambda x,y: x * y),
               '/': (lambda x,y: x // y),
               '?': '?'}
    func = op_dict[op]
    if func == '?': break 
    print('%d' % int(func(a, b)))

Fixed submission:
while True:
    a, op, b = input().split()
    a,b = int(a), int(b)
    op_dict = {'+': (lambda x,y: x + y),
               '-': (lambda x,y: x - y),
               '*': (lambda x,y: x * y),
               '/': (lambda x,y: x // y),
               '?': '?'}
    func = op_dict[op]
    if func == '?': break 
    print('%d' % int(func(a, b)))
Buggy python submission (verdict: Runtime Error):
def main():
    
    deck = set()
    for item in range(1,14):
        deck = deck | {('H ' + str(item))}
        deck = deck | {('D ' + str(item))}
        deck = deck | {('C ' + str(item))}
        deck = deck | {('S ' + str(item))}
    suits_order = ['S', 'H', 'C', 'D']
    
    n = int(input())
    cards = [input() for i in range(n)]
    remains = sorted(
        sorted(list(deck - set(cards)), key = lambda x: suit_order.index(x[:1])), 
        key = lambda x: int(x[2:]))
    for item in remains:
        print(item)


main()

Fixed submission:
def main():
    
    deck = set()
    for item in range(1,14):
        deck = deck | {('H ' + str(item))}
        deck = deck | {('D ' + str(item))}
        deck = deck | {('C ' + str(item))}
        deck = deck | {('S ' + str(item))}
    suits_order = ['S', 'H', 'C', 'D']
    
    n = int(input())
    cards = [input() for i in range(n)]
    remains = sorted(sorted(list(deck - set(cards)), key = lambda x: int(x[2:])), key = lambda x: suits_order.index(x[:1]))
    for item in remains:
        print(item)


main()

Buggy python submission (verdict: Runtime Error):
def main():
    
    deck = set()
    for item in range(1,14):
        deck = deck | {('H ' + str(item))}
        deck = deck | {('D ' + str(item))}
        deck = deck | {('C ' + str(item))}
        deck = deck | {('S ' + str(item))}
    suits_order = ['S', 'H', 'C', 'D']
    
    n = int(input())
    cards = [input() for i in range(n)]
    remains = sorted(sorted(list(deck - set(cards)), key = lambda x: suit_order.index(x[:1])), key = lambda x: int(x[2:]))
    for item in remains:
        print(item)


main()

Fixed submission:
def main():
    
    deck = set()
    for item in range(1,14):
        deck = deck | {('H ' + str(item))}
        deck = deck | {('D ' + str(item))}
        deck = deck | {('C ' + str(item))}
        deck = deck | {('S ' + str(item))}
    suits_order = ['S', 'H', 'C', 'D']
    
    n = int(input())
    cards = [input() for i in range(n)]
    remains = sorted(sorted(list(deck - set(cards)), key = lambda x: int(x[2:])), key = lambda x: suits_order.index(x[:1]))
    for item in remains:
        print(item)


main()
Buggy python submission (verdict: Runtime Error):
import itertools

def main():

    data = []
    while True:
        n, x = map(int, input().split())
        if [n, x] == [0, 0]: break
        data.append([n, x])

    for [n, x] in data:
        _set = set(range(1, n+1))
        comb = set(itertools.combinations(_list, 3))
        print(sum((True if sum(i) == x else False) for i in comb))


main()

Fixed submission:
import itertools

def main():

    data = []
    while True:
        n, x = map(int, input().split())
        if [n, x] == [0, 0]: break
        data.append([n, x])

    for [n, x] in data:
        _set = set(range(1, n+1))
        comb = set(itertools.combinations(_set, 3))
        print(sum((True if sum(i) == x else False) for i in comb))


main()
Buggy python submission (verdict: Runtime Error):
import math, sys
def lcm(a,b):
    return int(a*b/math.gcd(a,b))

if __name__ == '__main__':
    for line in sys.stdin:
        (a,b) = map(int,line.split())
        print(math.gcd(a,b),lcm(a,b))

Fixed submission:
import sys
import fractions
def lcm(a,b):
    return int(a*b/fractions.gcd(a,b))

if __name__ == '__main__':
    for line in sys.stdin:
        a,b = map(int,line.split())
        print(int(fractions.gcd(a,b)),lcm(a,b))

Buggy python submission (verdict: Runtime Error):
import math, sys
def lcm(a,b):
    return int(a*b/math.gcd(a,b))

if __name__ == '__main__':
    for line in sys.stdin:
        a,b = map(int,line.split())
        print(math.gcd(a,b),lcm(a,b))

Fixed submission:
import sys
import fractions
def lcm(a,b):
    return int(a*b/fractions.gcd(a,b))

if __name__ == '__main__':
    for line in sys.stdin:
        a,b = map(int,line.split())
        print(int(fractions.gcd(a,b)),lcm(a,b))

Buggy python submission (verdict: Runtime Error):
import math, sys
def lcm(a,b):
    return int(a*b/math.gcd(a,b))

if __name__ == '__main__':
    for line in sys.stdin:
        a,b = map(int,line.split())
        print(int(math.gcd(a,b)),lcm(a,b))

Fixed submission:
import sys
import fractions
def lcm(a,b):
    return int(a*b/fractions.gcd(a,b))

if __name__ == '__main__':
    for line in sys.stdin:
        a,b = map(int,line.split())
        print(int(fractions.gcd(a,b)),lcm(a,b))
Buggy python submission (verdict: Runtime Error):
import math
if __name__ == '__main__':
    n = int(input())
    for _ in range(n):
        x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split())
        #print((y2-y1)/(x2-x1) - (y4-y3)/(x4-x3))
        '''if math.fabs(x1 - x2) <= 0.00001 and math.fabs( x3 - x4) <= 0.00001:
            print("YES")
        elif math.fabs(x1 - x2) <= 0.00001:
            print("NO")
        elif math.fabs(x3 - x4) <= 0.00001:
            print("NO")
        else:
        '''
        if math.fabs((y2-y1)/(x2-x1) - (y4-y3)/(x4-x3)) <= 0.00001:
            print("YES")
        else:
            print("NO")

Fixed submission:
if __name__ == '__main__':
    n = int(input())
    for _ in range(n):
        x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split())
        #print((y2-y1)/(x2-x1) - (y4-y3)/(x4-x3))
        '''if math.fabs(x1 - x2) <= 0.00001 and math.fabs( x3 - x4) <= 0.00001:
            print("YES")
        elif math.fabs(x1 - x2) <= 0.00001:
            print("NO")
        elif math.fabs(x3 - x4) <= 0.00001:
            print("NO")
        else:
        '''
        if abs((x2-x1) * (y4-y3)-(x4-x3)*(y2-y1)) < 1e-10:
            print("YES")
        else:
            print("NO")

Buggy python submission (verdict: Runtime Error):
import math
if __name__ == '__main__':
    n = int(input())
    for _ in range(n):
        x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split())
        #print((y2-y1)/(x2-x1) - (y4-y3)/(x4-x3))
        '''if math.fabs(x1 - x2) <= 0.00001 and math.fabs( x3 - x4) <= 0.00001:
            print("YES")
        elif math.fabs(x1 - x2) <= 0.00001:
            print("NO")
        elif math.fabs(x3 - x4) <= 0.00001:
            print("NO")
        else:
        '''
        if math.fabs((y2-y1)//(x2-x1) - (y4-y3)//(x4-x3)) <= 0.00001:
            print("YES")
        else:
            print("NO")

Fixed submission:
if __name__ == '__main__':
    n = int(input())
    for _ in range(n):
        x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split())
        #print((y2-y1)/(x2-x1) - (y4-y3)/(x4-x3))
        '''if math.fabs(x1 - x2) <= 0.00001 and math.fabs( x3 - x4) <= 0.00001:
            print("YES")
        elif math.fabs(x1 - x2) <= 0.00001:
            print("NO")
        elif math.fabs(x3 - x4) <= 0.00001:
            print("NO")
        else:
        '''
        if abs((x2-x1) * (y4-y3)-(x4-x3)*(y2-y1)) < 1e-10:
            print("YES")
        else:
            print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
n = list(input())
sList = list(map(int,input().split()))

q = list(input())
tList = list(map(int,input().split()))

tCount = 0


for tmp_t in tList:
    if 0 < sList.count(tmp_t):
        tCount += 1

print(tCount)

Fixed submission:
n = list(input())
sList = list(map(int, input().split()))
sList = list(set(sList))
sList.sort()

q = list(input())
tList = list(map(int, input().split()))

tCount = 0


def middle_idx(tmin, tmax):
    return int((tmin + tmax) / 2)


for tmp_t in tList:
    tmp_min = 0
    tmp_max = len(sList) - 1
    if (tmp_t >= sList[tmp_min] and tmp_t <= sList[tmp_max]):
        while ( tmp_max - tmp_min > 1 ):
            tmp_mid = middle_idx(tmp_max, tmp_min)
            if sList[tmp_mid] > tmp_t:
                tmp_max = tmp_mid
            elif sList[tmp_mid] < tmp_t:
                tmp_min = tmp_mid
            elif sList[tmp_mid] == tmp_t:
                tmp_min = tmp_max
        if(sList[tmp_max] == tmp_t or sList[tmp_min] == tmp_t or sList[tmp_mid] == tmp_t):
            tCount += 1
    else:
        pass

print(tCount)
Buggy python submission (verdict: Time Limit Exceeded):
cnt = 0
def merge(A,left,mid,right):
	n1 = mid - left
	n2 = right - mid
	L = []
	R = []
	for i in range(0,n1):
		L.append(A[left+i])

	for i in range(0,n2):
		R.append(A[mid+i])
	L.append(1000000001)
	R.append(1000000001)


	i = 0
	j = 0
	global cnt
	for k in range(left,right):
		cnt += 1
		if L[i] <= R[j]:
			A[k]=L[i]
			i += 1
		else:
			A[k] = R[j]
			j += 1

def mergeSort(A,left,right):
	if left+1 < right:
		mid = (left+right)//2
		mergeSort(A,left,mid)
		mergeSort(A,mid,right)
		merge(A,left,mid,right)


if __name__ == '__main__':
	n = (int)(input())
	a = list(map(int,input().split()))
	
	mergeSort(a,0,len(a))
	print(*a)
	print(cnt)

Fixed submission:
cnt = 0
def merge(A,left,mid,right):
	'''n1 = mid - left
	n2 = right - mid
	L = []
	R = []
	for i in range(0,n1):
		L.append(A[left+i])

	for i in range(0,n2):
		R.append(A[mid+i])
	L.append(1000000001)
	R.append(1000000001)
	'''
	L = A[left:mid]+[1000000001]
	R = A[mid:right]+[1000000001]

	i = 0
	j = 0
	global cnt
	for k in range(left,right):
		cnt += 1
		if L[i] <= R[j]:
			A[k]=L[i]
			i += 1
		else:
			A[k] = R[j]
			j += 1

def mergeSort(A,left,right):
	if left+1 < right:
		mid = (left+right)//2
		mergeSort(A,left,mid)
		mergeSort(A,mid,right)
		merge(A,left,mid,right)


if __name__ == '__main__':
	n = (int)(input())
	a = list(map(int,input().split()))
	
	mergeSort(a,0,n)
	print(*a)
	print(cnt)
Buggy python submission (verdict: Runtime Error):
for line in sys.stdin:
        s=sum([int(num) for num in line.split(' ')])
        print(len(str(s)))

Fixed submission:
import sys
for line in sys.stdin:
        s=sum([int(num) for num in line.split(' ')])
        print(len(str(s)))

Buggy python submission (verdict: Runtime Error):
import os
for line in sys.stdin:
        s=sum([int(num) for num in line.split(' ')])
        print(len(str(s)))

Fixed submission:
import sys
for line in sys.stdin:
        s=sum([int(num) for num in line.split(' ')])
        print(len(str(s)))