Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
while True:
	line = input()
	if line == '':
		break
	a,b,c,d,e,f = [int(s) for s in line.split()]
	x = (c*e-b*f) / (a*e-b*d)
	y = (c*d-a*f) / (b*d-a*e)
	print('{0:.3f} {1:.3f}'.format(x,y))

Fixed submission:
import sys
for line in sys.stdin.readlines():
#for line in data.split('\n'):
	a,b,c,d,e,f = [int(s) for s in line.split()]
	x = (c*e-b*f) / (a*e-b*d)
	y = (c*d-a*f) / (b*d-a*e)
	if round(x,3) == 0.0:
		x = 0.0
	if round(y,3) == 0.0:
		y = 0.0
	print('{0:.3f} {1:.3f}'.format(x,y))

Buggy python submission (verdict: Runtime Error):
while True:
	line = input()
	if line == '':
		break
	a,b,c,d,e,f = [int(s) for s in line.split()]
	x = (c*e-b*f) / (a*e-b*d)
	y = (c*d-a*f) / (b*d-a*e)
	print('{0:.3f} {1:.3f}'.format(x,y))

Fixed submission:
import sys
for line in sys.stdin.readlines():
#for line in data.split('\n'):
	a,b,c,d,e,f = [int(s) for s in line.split()]
	x = (c*e-b*f) / (a*e-b*d)
	y = (c*d-a*f) / (b*d-a*e)
	if round(x,3) == 0.0:
		x = 0.0
	if round(y,3) == 0.0:
		y = 0.0
	print('{0:.3f} {1:.3f}'.format(x,y))

Buggy python submission (verdict: Runtime Error):
import sys
for line in sys.stdin.readlines()
	a,b,c,d,e,f = [int(s) for s in line.split()]
	x = (c*e-b*f) / (a*e-b*d)
	y = (c*d-a*f) / (b*d-a*e)
	print('{0:.3f} {1:.3f}'.format(x,y))

Fixed submission:
import sys
for line in sys.stdin.readlines():
#for line in data.split('\n'):
	a,b,c,d,e,f = [int(s) for s in line.split()]
	x = (c*e-b*f) / (a*e-b*d)
	y = (c*d-a*f) / (b*d-a*e)
	if round(x,3) == 0.0:
		x = 0.0
	if round(y,3) == 0.0:
		y = 0.0
	print('{0:.3f} {1:.3f}'.format(x,y))
Buggy python submission (verdict: Time Limit Exceeded):
while True:
    try:
        n = int(input())
    except:
        break
    p_table = list(range(2,n+1))
    p = 2
    i = 0
    while i < len(p_table):
        p = p_table[i]
        j = p + p
        while j <= n:
            if j in p_table:
                p_table.remove(j)
            j += p
        i += 1
    print(len(p_table))



Fixed submission:
def f(n):
    table = [False, False] + [True for _ in range(2, n+1)]
    p = 2
    while p**2 <= n:
        if table[p]:
            j = p + p
            while j <= n:
                table[j] = False
                j += p
        p += 1
    return sum(table)


while True:
    try:
        n = int(input())
    except:
        break
    print(f(n))
Buggy python submission (verdict: Runtime Error):
n = int(input())
data = []

for i in range(n):
	command,x = input().split()
	if command == 'insert':
		data.insert(0,x)
	elif command == 'delete':
		if x in data:
			data.remove(x)
	elif command == 'deleteFirst':
		data.pop(0)
	elif command == 'deleteLast':
		data.pop()

print(*data)

Fixed submission:
from collections import deque

n = int(input())
data = deque()

for i in range(n):
	command = input().split()
	if len(command) == 2:
		command,x = command
	else:
		command = command[0]
	if command == 'insert':
		data.appendleft(x)
	elif command == 'delete':
		if x in data:
			data.remove(x)
	elif command == 'deleteFirst':
		data.popleft()
	elif command == 'deleteLast':
		data.pop()

print(*data)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
data = []

for i in range(n):
	command = input().split()
	if len(command) == 2:
		command,x = command
	else:
		command = command[0]
	if command == 'insert':
		data.insert(0,x)
	elif command == 'delete':
		if x in data:
			data.remove(x)
	elif command == 'deleteFirst':
		data.pop(0)
	elif command == 'deleteLast':
		data.pop()

print(*data)

Fixed submission:
from collections import deque

n = int(input())
data = deque()

for i in range(n):
	command = input().split()
	if len(command) == 2:
		command,x = command
	else:
		command = command[0]
	if command == 'insert':
		data.appendleft(x)
	elif command == 'delete':
		if x in data:
			data.remove(x)
	elif command == 'deleteFirst':
		data.popleft()
	elif command == 'deleteLast':
		data.pop()

print(*data)
Buggy python submission (verdict: Runtime Error):
n = int(input())
dictionary = dict()
for i in range(n):
	command,data = input().split()
	if command = 'insert':
		dictionary[data] = 1
	else:
		if data in dictionary:
			print('yes')
		else:
			print('no')

Fixed submission:
n = int(input())
#n = int(lines.pop())

dictionary = dict()
for i in range(n):
	command,data = input().split()
	#command,data = lines.pop().split()
	if command == 'insert':
		dictionary[data] = 1
	else:
		if data in dictionary:
			print('yes')
		else:
			print('no')
Buggy python submission (verdict: Time Limit Exceeded):
n,k = [int(s) for s in input().split()]
#n,k = [int(s) for s in data.pop().split()]
w_org = []
[w_org.append(int(input())) for i in range(n)]
#[w_org.append(int(data.pop())) for i in range(n)]

def can(p_org,k):
	p = p_org
	w = w_org[:]
	while k and w:
		ww = w[0]
		if ww <= p:
			p -= ww
			w.pop(0)
		else:
			p = p_org
			k -= 1
		if p == 0:
			p = p_org
			k -= 1
		#print(ww,k,p)
	return not(w)


left,right = 0,sum(w_org)+1
while left+1 < right:
	middle = (left+right) // 2
	if can(middle,k):
		right = middle
	else:
		left = middle
print(right)

Fixed submission:
n,k = [int(s) for s in input().split()]
#n,k = [int(s) for s in data.pop().split()]
#n,k = 100000,100000
w_org = []
[w_org.append(int(input())) for i in range(n)]
#[w_org.append(int(data.pop())) for i in range(n)]
#w_org = [1 for i in range(n)]


def can(p_org,k):
	p = p_org
	w = w_org[::-1]
	while k and w:
		ww = w[-1]
		if ww <= p:
			p -= ww
			w.pop()
		else:
			p = p_org
			k -= 1
		if p == 0:
			p = p_org
			k -= 1
		#print(ww,k,p)
	return not(w)


left,right = max(w_org)-1,sum(w_org)+1
roop = 0
while left+1 < right:
	roop += 1
	middle = (left+right) // 2
	if can(middle,k):
		right = middle
	else:
		left = middle
print(right)

Buggy python submission (verdict: Time Limit Exceeded):
n,k = [int(s) for s in input().split()]
#n,k = [int(s) for s in data.pop().split()]
w_org = []
[w_org.append(int(input())) for i in range(n)]
#[w_org.append(int(data.pop())) for i in range(n)]

def can(p_org,k):
	p = p_org
	w = w_org[:]
	while k and w:
		ww = w[0]
		if ww <= p:
			p -= ww
			w.pop(0)
		else:
			p = p_org
			k -= 1
		if p == 0:
			p = p_org
			k -= 1
		#print(ww,k,p)
	return not(w)


left,right = max(w_org)-1,sum(w_org)+1
while left+1 < right:
	middle = (left+right) // 2
	if can(middle,k):
		right = middle
	else:
		left = middle
print(right)

Fixed submission:
n,k = [int(s) for s in input().split()]
#n,k = [int(s) for s in data.pop().split()]
#n,k = 100000,100000
w_org = []
[w_org.append(int(input())) for i in range(n)]
#[w_org.append(int(data.pop())) for i in range(n)]
#w_org = [1 for i in range(n)]


def can(p_org,k):
	p = p_org
	w = w_org[::-1]
	while k and w:
		ww = w[-1]
		if ww <= p:
			p -= ww
			w.pop()
		else:
			p = p_org
			k -= 1
		if p == 0:
			p = p_org
			k -= 1
		#print(ww,k,p)
	return not(w)


left,right = max(w_org)-1,sum(w_org)+1
roop = 0
while left+1 < right:
	roop += 1
	middle = (left+right) // 2
	if can(middle,k):
		right = middle
	else:
		left = middle
print(right)
Buggy python submission (verdict: Time Limit Exceeded):
def merge(S, left, mid, right, cnt):
	S1 = S[:left]
	S2 = S[left:mid][::-1]
	S3 = S[mid:right][::-1]
	S4 = S[right:]
	while S2 and S3:
		cnt += 1
		S1.append(min(S2,S3,key = lambda X:X[-1]).pop())
	S = S1 + S2[::-1] + S3[::-1] + S4
	cnt += (len(S2)+len(S3))
	return S,cnt

def merge_sort(S, left = 0, right = 500000, cnt = 0):
	right = min(len(S),right)
	if left+1 < right:
		mid = (left+right) // 2
		S,cnt = merge_sort(S, left, mid, cnt)
		S,cnt = merge_sort(S, mid, right, cnt)
		S,cnt = merge(S, left, mid, right, cnt)
	return S, cnt

if __name__ == '__main__':
	n = int(input())
	S = [int(s) for s in input().split()]
	S,cnt = merge_sort(S)
	print(*S)
	print(cnt)

Fixed submission:
def merge(S, left, mid, right):
	global cnt
	L = S[left:mid] + [float('inf')]
	R = S[mid:right] + [float('inf')]
	i,j = 0,0
	for k in range(left,right):
		if L[i] <= R[j]:
			S[k] = L[i]
			i += 1
		else:
			S[k] = R[j]
			j += 1
	cnt += right - left


def merge_sort(S, left = 0, right = 500000):
	right = min(len(S),right)
	if left+1 < right:
		mid = (left+right) // 2
		merge_sort(S, left, mid)
		merge_sort(S, mid, right)
		merge(S, left, mid, right)


if __name__ == '__main__':
	n = int(input())
	S = [int(s) for s in input().split()]
	cnt = 0
	merge_sort(S)
	print(*S)
	print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
def merge(S, left, mid, right):
	global cnt
	S1 = S[:left]
	S2 = S[left:mid][::-1]
	S3 = S[mid:right][::-1]
	S4 = S[right:]
	temp = []
	while S2 and S3:
		cnt += 1
		temp.append(min(S2,S3,key = lambda X:X[-1]).pop())
	temp += S2[::-1] + S3[::-1]
	cnt += (len(S2)+len(S3))
	S[left:right] = temp


def merge_sort(S, left = 0, right = 500000):
	right = min(len(S),right)
	if left+1 < right:
		mid = (left+right) // 2
		merge_sort(S, left, mid)
		merge_sort(S, mid, right)
		merge(S, left, mid, right)


if __name__ == '__main__':
	n = int(input())
	S = [int(s) for s in input().split()]
	cnt = 0
	merge_sort(S)
	print(*S)
	print(cnt)

Fixed submission:
def merge(S, left, mid, right):
	global cnt
	L = S[left:mid] + [float('inf')]
	R = S[mid:right] + [float('inf')]
	i,j = 0,0
	for k in range(left,right):
		if L[i] <= R[j]:
			S[k] = L[i]
			i += 1
		else:
			S[k] = R[j]
			j += 1
	cnt += right - left


def merge_sort(S, left = 0, right = 500000):
	right = min(len(S),right)
	if left+1 < right:
		mid = (left+right) // 2
		merge_sort(S, left, mid)
		merge_sort(S, mid, right)
		merge(S, left, mid, right)


if __name__ == '__main__':
	n = int(input())
	S = [int(s) for s in input().split()]
	cnt = 0
	merge_sort(S)
	print(*S)
	print(cnt)
Buggy python submission (verdict: Runtime Error):
import math

def koch(p2, n, points):
	p1 = points[-1]
	x, y = p2[0]-p1[0], p2[1]-p1[1]
	s = [p1[0]+x/3, p1[1]+y/3]
	t = [p1[0]+x*2/3, p1[1]+y*2/3]
	r = (x**2 + y**2) ** 0.5 / 3
	theta = math.atan(y/x) + math.pi/3
	u = [s[0]+r*math.cos(theta), s[1]+r*math.sin(theta)]
	
	if n == 1:
		points.extend([s,u,t,p2])
	else:
		koch(s, n-1, points)
		koch(u, n-1, points)
		koch(t, n-1, points)
		koch(p2, n-1, points)


if __name__ == '__main__':
	n = int(input())
	p1 = [0.0, 0.0]
	p2 = [100.0, 0.0]
	points = [p1]
	koch(p2, n, points)
	[print(*p) for p in points]

Fixed submission:
import math
th = math.pi/3

def koch(p2, n, points):
	p1 = points[-1]
	x, y = p2[0]-p1[0], p2[1]-p1[1]
	s = [p1[0]+x/3, p1[1]+y/3]
	t = [p1[0]+x*2/3, p1[1]+y*2/3]
	s0t = [t[0]-s[0], t[1]-s[1]]
	s0u = [math.cos(th)*s0t[0] - math.sin(th)*s0t[1],
	       math.sin(th)*s0t[0] + math.cos(th)*s0t[1]]
	u = [s[0]+s0u[0], s[1]+s0u[1]]
	
	if n == 0:
		points.append(p2)
	else:
		koch(s, n-1, points)
		koch(u, n-1, points)
		koch(t, n-1, points)
		koch(p2, n-1, points)


if __name__ == '__main__':
	n = int(input())
	p1 = [0.0, 0.0]
	p2 = [100.0, 0.0]
	points = [p1]
	koch(p2, n, points)
	[print(*p) for p in points]
Buggy python submission (verdict: Runtime Error):
x1,y1,x2,y2 = [int(s) for s in input().split(' ')]

print(((x1-x2)**2 + (y1-y2)**2)**0.5)

Fixed submission:
x1,y1,x2,y2 = [float(s) for s in input().split(' ')]

print(((x1-x2)**2 + (y1-y2)**2)**0.5)

Buggy python submission (verdict: Runtime Error):
x1,y1,x2,y2 = [int(s) for s in input().split(' ')]

print(((x1-x2)**2 + (y1-y2)**2)**0.5)

Fixed submission:
x1,y1,x2,y2 = [float(s) for s in input().split(' ')]

print(((x1-x2)**2 + (y1-y2)**2)**0.5)
Buggy python submission (verdict: Runtime Error):
import math

r = int(input())
print('{0} {1}'.format(math.pi*r**2,2*math.pi*r))

Fixed submission:
import math

r = float(input())
print('{0} {1}'.format(math.pi*r**2,2*math.pi*r))

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

r = int(input())
print('{0} {1}'.format(math.pi*r**2,2*math.pi*r))

Fixed submission:
import math

r = float(input())
print('{0} {1}'.format(math.pi*r**2,2*math.pi*r))

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

r = int(input())
print('{0} {1}'.format(math.pi*(r**2),2*math.pi*r))

Fixed submission:
import math

r = float(input())
print('{0} {1}'.format(math.pi*r**2,2*math.pi*r))
Buggy python submission (verdict: Runtime Error):
from string import ascii_lowercase as letters

data = ''
while True:
	temp = input()
	if temp == '':
		break
	else:
		data += temp.lower()

num = [data.count(s) for s in letters]
ans = '\n'.join(['{0} : {1}'.format(s,n) for s,n in zip(list(letters),num)])
print(ans)

Fixed submission:
from string import ascii_lowercase as letters
import sys
data = sys.stdin.read().lower()

num = [data.count(s) for s in letters]
ans = '\n'.join(['{0} : {1}'.format(s,n) for s,n in zip(list(letters),num)])
print(ans)

Buggy python submission (verdict: Runtime Error):
from string import ascii_lowercase as letters

data = ''
while True:
	temp = input()
	if temp == '':
		break
	else:
		data += temp.lower()

num = [data.count(s) for s in letters]
ans = '\n'.join(['{0} : {1}'.format(s,n) for s,n in zip(list(letters),num)])
print(ans)

Fixed submission:
from string import ascii_lowercase as letters
import sys
data = sys.stdin.read().lower()

num = [data.count(s) for s in letters]
ans = '\n'.join(['{0} : {1}'.format(s,n) for s,n in zip(list(letters),num)])
print(ans)

Buggy python submission (verdict: Runtime Error):
from string import ascii_lowercase as letters

data = ''
while True:
	temp = input()
	if temp == '':
		break
	else:
		data += temp.lower()

num = [data.count(s) for s in letters]
ans = '\n'.join(['{0} : {1}'.format(s,n) for s,n in zip(list(letters),num)])
print(ans)

Fixed submission:
from string import ascii_lowercase as letters
import sys
data = sys.stdin.read().lower()

num = [data.count(s) for s in letters]
ans = '\n'.join(['{0} : {1}'.format(s,n) for s,n in zip(list(letters),num)])
print(ans)

Buggy python submission (verdict: Runtime Error):
from string import ascii_lowercase as letters

data = ''
while True:
	temp = input()
	if temp == '':
		break
	else:
		data += temp.lower()

num = [data.count(s) for s in letters]
ans = '\n'.join(['{0} : {1}'.format(s,n) for s,n in zip(list(letters),num)])
print(ans)

Fixed submission:
from string import ascii_lowercase as letters
import sys
data = sys.stdin.read().lower()

num = [data.count(s) for s in letters]
ans = '\n'.join(['{0} : {1}'.format(s,n) for s,n in zip(list(letters),num)])
print(ans)

Buggy python submission (verdict: Runtime Error):
from string import ascii_lowercase as letters

data = ''
while True:
	temp = input()
	if temp == '':
		break
	else:
		data += temp.lower()
'''
num = [data.count(s) for s in letters]
ans = '\n'.join(['{0} : {1}'.format(s,n) for s,n in zip(list(letters),num)])
print(ans)
'''
print('')

Fixed submission:
from string import ascii_lowercase as letters
import sys
data = sys.stdin.read().lower()

num = [data.count(s) for s in letters]
ans = '\n'.join(['{0} : {1}'.format(s,n) for s,n in zip(list(letters),num)])
print(ans)
Buggy python submission (verdict: Runtime Error):
sec = int(input())

min = sec / 60
hour = min / 60

min -= hour * 60
sec %= 60

print(hour+":"+min+":"+sec)

Fixed submission:
# coding: utf-8

sec  = int(input())

hun  = int(sec/60)
hour = int(hun/60)

hun -= hour * 60
sec %= 60

print(hour,end=":")
print(hun,end=":")
print(sec)

Buggy python submission (verdict: Runtime Error):
sec = int(input())

min = int(sec / 60)
hour = int(min / 60)

min -= hour * 60
sec %= 60

print(hour+":"+min+":"+sec)

Fixed submission:
# coding: utf-8

sec  = int(input())

hun  = int(sec/60)
hour = int(hun/60)

hun -= hour * 60
sec %= 60

print(hour,end=":")
print(hun,end=":")
print(sec)
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
r = [None] * n
min = math.inf
max = -math.inf
for i in range(n):
    r[i] = int(input())

for i in range(n):
    if min > r[i]:
        min = r[i]
        for j in range(i+1,n):
            if max < r[j] - min:
                max = r[j] - min
print(max)

Fixed submission:
n = int(input())
minv = int(input())
maxv = (10**9)*(-1)
for j in range(1,n):
    r = int(input())
    if maxv < (r - minv):
        maxv = r - minv
    if minv > r:
        minv = r
print(maxv)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
r = [None] * n
min = 10**10
max = -10**10
for i in range(n):
    r[i] = int(input())

for i in range(n):
    if min > r[i]:
        min = r[i]
        for j in range(i+1,n):
            if max < r[j] - min:
                max = r[j] - min
print(max)

Fixed submission:
n = int(input())
minv = int(input())
maxv = (10**9)*(-1)
for j in range(1,n):
    r = int(input())
    if maxv < (r - minv):
        maxv = r - minv
    if minv > r:
        minv = r
print(maxv)
Buggy python submission (verdict: Runtime Error):
a,b = list(map(int,input().split(" "))

print(a*b,a*2+b*2)

Fixed submission:
a,b = list(map(int,input().split(" ")))
 
print(a*b,a*2+b*2)
Buggy python submission (verdict: Runtime Error):
import math
r = int(input())
c = math.pi*r**2
s = 2*math.pi*r
print("{0:.7f} {1:.7f}".format(c,s))

Fixed submission:
pi = 3.141592653589
r = float(input())
c = pi*r**2
s = 2*pi*r
print('%.5f %.5f' % (c,s))

Buggy python submission (verdict: Runtime Error):
pi = 3.141592653589
r = int(input())
c = pi*r**2
s = 2*pi*r
print("{0:.7f} {1:.7f}".format(c,s))

Fixed submission:
pi = 3.141592653589
r = float(input())
c = pi*r**2
s = 2*pi*r
print('%.5f %.5f' % (c,s))
Buggy python submission (verdict: Time Limit Exceeded):
while True:
    n,x=[int(i) for i in input().split()]
    if n==x==0:
        break
    c = 0
    for i in range(1,n+1):
        for j in range(1,n+1):
            if (i != j):
                for k in range(1,n+1):
                    if (i != k and j != k):
                        if(i<j<k):
                            if i+j+k == x:
                                c+=1

    print(c)

Fixed submission:
while True:
    n,x=[int(i) for i in input().split()]
    if n==x==0:
        break
    c = 0
    for i in range(1,n+1):
        for j in range(i+1,n+1):
            if (i+j+n >= x):
                for k in range(j+1,n+1):
                    if(i+j+k == x):
                        c+=1
                        break

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

while True:
	try:
		a, b = map(int, input().split())
		print(int(math.log10(a + b, 10)) + 1)
	except EOFError:
		break

Fixed submission:
import math

while True:
	try:
		a, b = map(int, input().split())
		print(int(math.log10(a + b)) + 1)
	except EOFError:
		break
Buggy python submission (verdict: Runtime Error):
import math

r = int(input())
print("{:.6f} {:.6f}\n".format(math.pi * r ** 2, 2 * math.pi * r))

Fixed submission:
import math

r = float(input())
print("{:.6f} {:.6f}\n".format(math.pi * r ** 2, 2 * math.pi * r))
Buggy python submission (verdict: Runtime Error):
n = int(input())

l = []
for _ in range(n):
    command = input().split()
    if command[0] == "insert":
        l.append(command[1])
    elif command[0] == "delete":
        ind = l.index(command[1])
        l.pop(ind)
    elif command[0] == "deleteFirst":
        l.pop(0)
    elif command[0] == "deleteLast":
        l.pop(-1)
        
print (" ".join(l[::-1]))

Fixed submission:
from collections import deque

n = int(input())

l = deque()
for _ in range(n):
    command = input().split()
    if command[0] == "insert":
        l.appendleft(command[1])
    elif command[0] == "delete":
        try:
            ind = l.remove(command[1])
        except ValueError:
            pass
    elif command[0] == "deleteFirst":
        l.popleft()
    elif command[0] == "deleteLast":
        l.pop()
        
print (" ".join(l))
Buggy python submission (verdict: Runtime Error):
import math
while True:
    try:
        x1, y1, x2, y2, x3, y3, xp, yp = map(float, input().split())
    except:
        break
    x = [x1, x2, x3, x1]
    y = [y1, y2, y3, y1]
    x = list(map(lambda i: i - xp, x))
    y = list(map(lambda i: i - yp, y))
    s = lambda a1, a2, b1, b2: abs(a1 * b2 - a2 * b1)
    sum = sum(s(x[i], y[i], x[i + 1], y[i + 1]) for i in range(3))
    S = s(x[1] - x[0], y[1] - y[0], x[2] - x[0], y[2] - y[0])
    if sum == S:
        print('YES')
    else:
        print('NO')

Fixed submission:
import math
while True:
    try:
        x1, y1, x2, y2, x3, y3, xp, yp = map(float, input().split())
    except:
        break
    x = [x1, x2, x3, x1]
    y = [y1, y2, y3, y1]
    x = list(map(lambda i: i - xp, x))
    y = list(map(lambda i: i - yp, y))
    s = lambda a1, a2, b1, b2: abs(a1 * b2 - a2 * b1)
    S3 = sum(s(x[i], y[i], x[i + 1], y[i + 1]) for i in range(3))
    S = s(x[1] - x[0], y[1] - y[0], x[2] - x[0], y[2] - y[0])
    if S3 == S:
        print('YES')
    else:
        print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
while True:
    n = int(input())
    if n == 0:
        break
    a = []
    for _ in range(n):
        a.append(int(input()))
    print(max(max(sum(a[j:j + i + 1]) for j in range(n - i)) for i in range(n)))

Fixed submission:
while True:
    n = int(input())
    if not n:
        break
    a = [int(input()) for _ in range(n)]
    for i in range(1, n):
        if a[i - 1] > 0:
            a[i] += a[i - 1]
    print(max(a))

Buggy python submission (verdict: Time Limit Exceeded):
while True:
    n = int(input())
    if n == 0:
        break
    a = [int(input()) for _ in range(n)]
    b = []
    while a != []:
        for i in range(len(a)):
            if i == len(a) - 1 or a[i] * a[i + 1] < 0:
                b.append(sum(a[:i + 1]))
                a[:i + 1] = []
                break
    print(max(max(sum(b[j:j + i + 1]) for j in range(len(b) - i)) for i in range(len(b))))

Fixed submission:
while True:
    n = int(input())
    if not n:
        break
    a = [int(input()) for _ in range(n)]
    for i in range(1, n):
        if a[i - 1] > 0:
            a[i] += a[i - 1]
    print(max(a))

Buggy python submission (verdict: Runtime Error):
while True:
    n = int(input())
    if n == 0:
        break
    a = [int(input()) for _ in range(n)]
    b = []
    while a != []:
        for i in range(len(a) - 1):
            if a[i] * a[i + 1] < 0:
                b.append(sum(a[:i + 1]))
                a[:i + 1] = []
                break
        else:
            b.append(sum(a))
            a = []
    for i in range(1, len(b)):
        if b[i - 1] > 0:
            b[i] += b[i - 1]
    print(max(b)

Fixed submission:
while True:
    n = int(input())
    if not n:
        break
    a = [int(input()) for _ in range(n)]
    for i in range(1, n):
        if a[i - 1] > 0:
            a[i] += a[i - 1]
    print(max(a))
Buggy python submission (verdict: Runtime Error):
days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
nums = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
while True:
    try:
        m, d = map(int, input().split())
        if not m:
            break
    except:
        break
    print(days[(sum(nums[:m - 1]) + d) % 7 + 2])

Fixed submission:
days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
nums = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
while True:
    try:
        m, d = map(int, input().split())
        if not m:
            break
    except:
        break
    print(days[(sum(nums[:m - 1]) + d + 2) % 7])