Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
while True:
	H, W = map(int, raw_input().split())
	if H == 0 and W == 0:
		break
	array = [[raw_input() for i in range(W)] for j in range(H)]
	x = y = 0
	while True: 
		w = array[x][y]
		if w == ".":
			print x, y
			break
		if w == ">":
			x += 1
		elif w == "v":
			y += 1
		elif w == "^":
			y -= 1
		elif w == "<": 
			x -= 1
		else:
			print "LOOP"
			break

Fixed submission:
while True:
    h, w = map(int, raw_input().split())
    if w == 0 and h == 0:
        break
    tile = []
    for i in range(h):
        tile.append(list(raw_input()))
    x = y = 0
    while True:
        a = tile[y][x]
        tile[y][x] = 0
        if   a == ">": x += 1
        elif a == "<": x -= 1
        elif a == "^": y -= 1
        elif a == "v": y += 1
        elif a == ".": print x,y; break
        else: print "LOOP"; break

Buggy python submission (verdict: Runtime Error):
while True:
	H, W = map(int, raw_input().split())
	if H == 0 and W == 0:
		break
	tile = []
	for i in range(H):
		tile.append(list(raw_input()))
	x = y = 0
	while True: 
		a = tile[y][x]
		tile[y][x] = 0
		if w == ".":
			print x, y
			break
		if w == ">":
			x += 1
		elif w == "v":
			y += 1
		elif w == "^":
			y -= 1
		elif w == "<": 
			x -= 1
		else:
			print "LOOP"
			break

Fixed submission:
while True:
    h, w = map(int, raw_input().split())
    if w == 0 and h == 0:
        break
    tile = []
    for i in range(h):
        tile.append(list(raw_input()))
    x = y = 0
    while True:
        a = tile[y][x]
        tile[y][x] = 0
        if   a == ">": x += 1
        elif a == "<": x -= 1
        elif a == "^": y -= 1
        elif a == "v": y += 1
        elif a == ".": print x,y; break
        else: print "LOOP"; break

Buggy python submission (verdict: Runtime Error):
while True:
	H, W = map(int, raw_input().split())
	if H == 0 and W == 0:
		break
	tile = []
	for i in range(H):
		tile.append(list(raw_input()))
	x = y = 0
	while True: 
		a = tile[y][x]
		tile[y][x] = 0
		if w == ".":
			print x, y;break
		elif w == ">":
			x += 1
		elif w == "v":
			y += 1
		elif w == "^":
			y -= 1
		elif w == "<": 
			x -= 1
		else:
			print "LOOP";break

Fixed submission:
while True:
    h, w = map(int, raw_input().split())
    if w == 0 and h == 0:
        break
    tile = []
    for i in range(h):
        tile.append(list(raw_input()))
    x = y = 0
    while True:
        a = tile[y][x]
        tile[y][x] = 0
        if   a == ">": x += 1
        elif a == "<": x -= 1
        elif a == "^": y -= 1
        elif a == "v": y += 1
        elif a == ".": print x,y; break
        else: print "LOOP"; break
Buggy python submission (verdict: Time Limit Exceeded):
def fib(n):
	if n == 0:
		return 1
	elif n == 1:
		return 1
	else:
		return fib(n - 1) + fib(n - 2)

n = input()
print fib(n)

Fixed submission:
cache = {}
def fib(x):
	if x in cache:
		return cache[x]
	elif x == 0 or x == 1:
		return 1
	else:
		v = fib(x - 1) + fib(x - 2)
		cache[x] = v
		return v

x = input()
print fib(x)

Buggy python submission (verdict: Runtime Error):
cache = []

def fib(x):
	if x in cache:
		return cache[x]
	elif x == 0 or x == 1:
		return 1
	else:
		v = fib(x - 1) + fib(x - 2)
		cache[x] = v
		return v

x = input()
print fib(x)

Fixed submission:
cache = {}
def fib(x):
	if x in cache:
		return cache[x]
	elif x == 0 or x == 1:
		return 1
	else:
		v = fib(x - 1) + fib(x - 2)
		cache[x] = v
		return v

x = input()
print fib(x)
Buggy python submission (verdict: Runtime Error):
# 入力
n = int(raw_input())
# 隣接行列を格納する配列
x = [[0 for i in range(n)] for j in range(n)]
for i in range(n):
	seq = map(int,raw_input().split())
	tmp = seq[0]-1
	n2 = seq[1]
	if n2!=0:
		for e in seq[2:]:
			x[tmp][e-1]=1
for i in range(n):
	print " ".join(map(str,x[i]))

Fixed submission:
n = int(raw_input())
x = [[0 for i in range(n)] for j in range(n)]
for i in range(n):
	seq = map(int,raw_input().split())
	tmp = seq[0]-1
	n2 = seq[1]
	if n2!=0:
		for e in seq[2:]:
			x[tmp][e-1]=1
for i in range(n):
	print " ".join(map(str,x[i]))
Buggy python submission (verdict: Runtime Error):
def gcd(x, y):
	n = min(x, y)
	array = range(1, n + 1)
	array.reverse()
	for d in array:
		if x % d == 0 and y % d == 0:
			return d

a, b = map(int, raw_input().split(' '))

print gcd(a, b)

Fixed submission:
def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)

a, b = map(int, raw_input().split(' '))

print gcd(a, b)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(raw_input())
R = []
for i in range(0, N):
	R.append(int(raw_input()))
R.reverse()
max_num = -999999999

for x, i in enumerate(R[:N - 1]):
	for j in R[x + 1:]:		
		if max_num <(i - j):
			max_num = i - j

print max_num

Fixed submission:
n = int(raw_input())
R = [input() for i in range(n)]
maxv = -2000000000
minv = R[0]
for j in range(1, n):
	maxv = max(maxv, R[j]-minv)
	minv = min(minv, R[j])
print maxv

Buggy python submission (verdict: Time Limit Exceeded):
N = int(raw_input())
R = []
for i in range(0, N):
	R.append(int(raw_input()))
R.reverse()
max_num = -999999999

for x, i in enumerate(R[:N - 1]):
	for j in R[x + 1:]:		
		if max_num <(i - j):
			max_num = i - j

print max_num

Fixed submission:
n = int(raw_input())
R = [input() for i in range(n)]
maxv = -2000000000
minv = R[0]
for j in range(1, n):
	maxv = max(maxv, R[j]-minv)
	minv = min(minv, R[j])
print maxv
Buggy python submission (verdict: Time Limit Exceeded):

n = int(raw_input())
S = []
S = map(int, raw_input().split())

q = int(raw_input())
T = []
T = map(int, raw_input().split())

count = 0

for i in T:
	if i in S:
		count += 1

print count

Fixed submission:
def binarySearch(S, key):
	left = 0
	right = len(S)
	while left < right:
		mid = (left + right) / 2
		if S[mid] == key:
			return True		
		elif key < S[mid]:
			right = mid
		else:
			left = mid + 1
	return False


n = int(raw_input())
S = []
S = map(int, raw_input().split())

q = int(raw_input())
T = []
T = map(int, raw_input().split())
count = 0
for key in T:
	if binarySearch(S, key):
		count += 1
print count
Buggy python submission (verdict: Runtime Error):
import math

point = map(int, raw_input().split())
x1 = point[0]
y1 = point[1]
x2 = point[2]
y2 = point[3]

distance = math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)
print distance

Fixed submission:
import math

point = map(float, raw_input().split())
x1 = point[0]
y1 = point[1]
x2 = point[2]
y2 = point[3]

distance = math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)
print distance
Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
	input_a = input()
	input_b = input()
	a = 2*input_a+2*input_b
	b = input_a*input_b
	print b, a

Fixed submission:
n, m = map(int, raw_input().split())
print n*m, 2*n+2*m

Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
	input_a = input()
	input_b = input()
	a = 2*input_a+2*input_b
	b = input_a*input_b
	print b," ", a

Fixed submission:
n, m = map(int, raw_input().split())
print n*m, 2*n+2*m

Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
	input_a = input()
	input_b = input()
	a = 2*input_a+2*input_b
	b = input_a*input_b
	print b," ", a

Fixed submission:
n, m = map(int, raw_input().split())
print n*m, 2*n+2*m

Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
	input_a = input()
	input_b = input()
	
	print input_a*input_b," ",2*input_a+2*input_b

Fixed submission:
n, m = map(int, raw_input().split())
print n*m, 2*n+2*m

Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
	input_a = input()
	input_b = input()
	
	print input_a*input_b,2*input_a+2*input_b

Fixed submission:
n, m = map(int, raw_input().split())
print n*m, 2*n+2*m

Buggy python submission (verdict: Runtime Error):
input_a = input()
input_b = input()
	
print input_a*input_b,2*input_a+2*input_b

Fixed submission:
n, m = map(int, raw_input().split())
print n*m, 2*n+2*m

Buggy python submission (verdict: Runtime Error):
input_a = input()
input_b = input()
	
print input_a*input_b," ",2*input_a+2*input_b

Fixed submission:
n, m = map(int, raw_input().split())
print n*m, 2*n+2*m

Buggy python submission (verdict: Runtime Error):
input_a = input()
input_b = input()
	
print (input_a*input_b, " ", 2*input_a+2*input_b)

Fixed submission:
n, m = map(int, raw_input().split())
print n*m, 2*n+2*m
Buggy python submission (verdict: Runtime Error):
a, b = int(raw_input())
a = int(raw_input())
 
b, c  = divmod(a, 3600)
d, e = divmod(c, 60)

print ("%d:%d:%d") % (b,d,e)

Fixed submission:
a, b = map(int, raw_input().split())
if a > b:
	print "a > b"
elif a < b:
	print "a < b"
else:
	print "a == b"

Buggy python submission (verdict: Runtime Error):
a, b = int(rawinput())
if a > b:
	print "a > b"
elif a < b:
	print "a < b"
else:
	print "a == b"

Fixed submission:
a, b = map(int, raw_input().split())
if a > b:
	print "a > b"
elif a < b:
	print "a < b"
else:
	print "a == b"

Buggy python submission (verdict: Runtime Error):
a, b = int(raw_input())
if a > b:
	print "a > b"
elif a < b:
	print "a < b"
else:
	print "a == b"

Fixed submission:
a, b = map(int, raw_input().split())
if a > b:
	print "a > b"
elif a < b:
	print "a < b"
else:
	print "a == b"

Buggy python submission (verdict: Runtime Error):
a, b = int(raw_input())
if a > b:
	print "a > b"
elif a < b:
	print "a < b"
else:
	print "a == b"

Fixed submission:
a, b = map(int, raw_input().split())
if a > b:
	print "a > b"
elif a < b:
	print "a < b"
else:
	print "a == b"
Buggy python submission (verdict: Runtime Error):
import math

a = int(raw_input())

b = (pow(a, 2) * math.pi)
c = 2 * a * math.pi
print format(b,"0.6f"), format(c, ".6f")

Fixed submission:
import math
a = float(raw_input())

b = (pow(a, 2) * math.pi)
c = 2 * a * math.pi
print format(b,".6f"), format(c, ".6f")

Buggy python submission (verdict: Runtime Error):
import math
a = int(raw_input())

b = (pow(a, 2) * math.pi)
c = 2 * a * math.pi
print format(b,"0.6f"), format(c, ".6f")

Fixed submission:
import math
a = float(raw_input())

b = (pow(a, 2) * math.pi)
c = 2 * a * math.pi
print format(b,".6f"), format(c, ".6f")
Buggy python submission (verdict: Runtime Error):
import re

def f(s):
    for i in range(0,10):
        t = s.replace("X", str(i))
        a, b, c = map(int, re.split(r'\+|\=', t))
        if a + b == c and str(a) + "+" + str(b) + "=" + str(c) == t:
            return i
    return "NA"

while (1):
    print f(raw_input())

Fixed submission:
import re

def f(s):
    for i in range(0,10):
        t = s.replace("X", str(i))
        a, b, c = map(int, re.split(r'\+|\=', t))
        if a + b == c and str(a) + "+" + str(b) + "=" + str(c) == t:
            return i
    return "NA"

while True:
    try:
        print f(raw_input())
    except:
        break
Buggy python submission (verdict: Runtime Error):
def cv(t):
	return t/100*60+t%100

while 1:
	n=input(); p=input(); q=input()
	if n==0: break
	v=[0]*1440
	for i in range(n):
		k=input()
		for j in range(k):
			a=input(); b=input();
			for l in range(cv(a),cv(b)):
				v[l]+=1
	m=c=0
	for i in range(cv(p),cv(q)):
		c=c+1 if v[i]<n else 0
		m=max(m,c)
	print m

Fixed submission:
def get():
	return map(int,raw_input().split())
def cv(t):
	return t/100*60+t%100
while 1:
	n,p,q=get()
	if n==0: break
	v=[0]*1440
	for i in range(n):
		k=get()[0]; a=get()
		for j in range(k):
			for l in range(cv(a[::2][j]),cv(a[1::2][j])):
				v[l]+=1
	m=c=0
	for i in range(cv(p),cv(q)):
		c=(c+1)*(v[i]<n)
		m=max(m,c)
	print m
Buggy python submission (verdict: Runtime Error):
while 1:
    n = raw_input()
    if x == '0': break;
    print reduce(lambda x,y: x+int(y), n, 0)

Fixed submission:
while 1:
    x = raw_input()
    if x == '0': break;
    print sum(int(s) for s in x)
Buggy python submission (verdict: Runtime Error):
import math

class Circle:
    def output(self, r):
        print "%.6f %.6f" % (math.pi * r * r, 2.0 * math.pi * r)

if __name__ == "__main__":
    cir = Circle()
    r = int(raw_input())
    cir.output(r)

Fixed submission:
import math

class Circle:
    def output(self, r):
        print "%.6f %.6f" % (math.pi * r * r, 2.0 * math.pi * r)

if __name__ == "__main__":
    cir = Circle()
    r = float(raw_input())
    cir.output(r)

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

class Circle:
    def output(self, r):
        print "%.6f %.6f" % (math.pi * r * r, 2.0 * math.pi * r)

if __name__ == "__main__":
    cir = Circle()
    r = int(raw_input())
    cir.output(r)

Fixed submission:
import math

class Circle:
    def output(self, r):
        print "%.6f %.6f" % (math.pi * r * r, 2.0 * math.pi * r)

if __name__ == "__main__":
    cir = Circle()
    r = float(raw_input())
    cir.output(r)
Buggy python submission (verdict: Runtime Error):
class ReversingNumbers:
    def output(self, a):
        s = ""
        a.reverse()
        for i in range(len(a)-1):
            s += "%d " % (a[i])
        s += "%d" % (a.index(len(a)-1))
        print s

if __name__ == "__main__":
    rn = ReversingNumbers()
    raw_input()
    a = map(int, raw_input().split())
    rn.output(a)

Fixed submission:
class ReversingNumbers:
    def output(self, a):
        s = ""
        a.reverse()
        for i in range(len(a)-1):
            s += "%d " % (a[i])
        s += "%d" % (a[len(a)-1])
        print s

if __name__ == "__main__":
    rn = ReversingNumbers()
    raw_input()
    a = map(int, raw_input().split())
    rn.output(a)

Buggy python submission (verdict: Runtime Error):
class ReversingNumbers:
    def output(self, a):
        s = ""
        a.reverse()
        for i in range(len(a)-1):
            s += "%d " % (a[i])
        s += "%d" % (a.index(len(a)-1))
        print s

if __name__ == "__main__":
    rn = ReversingNumbers()
    raw_input()
    a = map(int, raw_input().split())
    rn.output(a)

Fixed submission:
class ReversingNumbers:
    def output(self, a):
        s = ""
        a.reverse()
        for i in range(len(a)-1):
            s += "%d " % (a[i])
        s += "%d" % (a[len(a)-1])
        print s

if __name__ == "__main__":
    rn = ReversingNumbers()
    raw_input()
    a = map(int, raw_input().split())
    rn.output(a)
Buggy python submission (verdict: Runtime Error):


team = [0 for i in range(101)]
point= [[0 for i in range(2)] for i in range(31)]
while 1:
    temp= map(int, raw_input().split(','))
    if temp[0] ==0==temp[1]:
        break
    team[temp[0]]=temp[1]
    if point[temp[1]][1]==0:
        point[temp[1]][1]=1
        for i in range(temp[1]+1):
            point[i][0]+=1
while 1:
    n = input()
    print point[team[n]][0]

Fixed submission:
team = [0 for i in range(101)]
point= [[0 for i in range(2)] for i in range(31)]
while 1:
    temp= map(int, raw_input().split(','))
    if temp[0] ==0==temp[1]:
        break
    team[temp[0]]=temp[1]
    if point[temp[1]][1]==0:
        point[temp[1]][1]=1
        for i in range(temp[1]+1):
            point[i][0]+=1
while 1:
    try:
        n = input()
        print point[team[n]][0]
    except EOFError:
	break

Buggy python submission (verdict: Runtime Error):
team = [0 for i in range(101)]
point= [[0 for i in range(2)] for i in range(31)]
while 1:
    temp= map(int, raw_input().split(','))
    if temp[0] ==0==temp[1]:
        break
    team[temp[0]]=temp[1]
    if point[temp[1]][1]==0:
        point[temp[1]][1]=1
        for i in range(temp[1]+1):
            point[i][0]+=1
while 1:
    try:
        n = input()
        print point[team[n]][0]
    except EOFerror:
	break

Fixed submission:
team = [0 for i in range(101)]
point= [[0 for i in range(2)] for i in range(31)]
while 1:
    temp= map(int, raw_input().split(','))
    if temp[0] ==0==temp[1]:
        break
    team[temp[0]]=temp[1]
    if point[temp[1]][1]==0:
        point[temp[1]][1]=1
        for i in range(temp[1]+1):
            point[i][0]+=1
while 1:
    try:
        n = input()
        print point[team[n]][0]
    except EOFError:
	break
Buggy python submission (verdict: Runtime Error):
import sys

def main():
  n = int(sys.stdin.readline())
  for _ in range(n):
    line = sys.stdin.readline()
    print(line.strip().replace("Hoshino", "Hoshina"), end="\n")

if __name__ == "__main__":
  main()

Fixed submission:
import sys

def main():
  n = int(sys.stdin.readline())
  for _ in range(n):
    line = sys.stdin.readline()
    print(line.rstrip().replace("Hoshino", "Hoshina"))

if __name__ == "__main__":
  main()
Buggy python submission (verdict: Runtime Error):
def insert(S, string):
    S.append(string)

def find(S, string):
    cnt = 0
    for i in range(len(S)):
        cnt = cnt + 1
        if S[i] == string:
            print 'yes'
            break
        elif cnt == len(S):
            print 'no'

n = input()

S = []

for i in range(n):
    tmp1, tmp2  = map(str,raw_input().split())
    if tmp1 == 'insert':
        insert(S, tmp2)
    elif tmp1 == 'find':
        find(S, tmp2)
    else:
        print 'error!'

Fixed submission:
def insert(S, string):
    S.add(string)

def find(S, string):
    if string in S:
        print 'yes'
    else:
        print 'no'

n = input()

S = set()

for i in range(n):
    tmp1, tmp2  = map(str, raw_input().split())
    if tmp1 == 'insert':
        insert(S, tmp2)
    elif tmp1 == 'find':
        find(S, tmp2)
    else:
        print 'error!'

Buggy python submission (verdict: Time Limit Exceeded):
def insert(S, string):
    S.append(string)

def find(S, string):
    cnt = 0
    for i in range(len(S)):
        cnt = cnt + 1
        if S[i] == string:
            print 'yes'
            break
        elif cnt == len(S):
            print 'no'

    if cnt == 0:
        print 'no'

n = input()

S = []

for i in range(n):
    tmp1, tmp2  = map(str,raw_input().split())
    if tmp1 == 'insert':
        insert(S, tmp2)
    elif tmp1 == 'find':
        find(S, tmp2)
    else:
        print 'error!'

Fixed submission:
def insert(S, string):
    S.add(string)

def find(S, string):
    if string in S:
        print 'yes'
    else:
        print 'no'

n = input()

S = set()

for i in range(n):
    tmp1, tmp2  = map(str, raw_input().split())
    if tmp1 == 'insert':
        insert(S, tmp2)
    elif tmp1 == 'find':
        find(S, tmp2)
    else:
        print 'error!'

Buggy python submission (verdict: Time Limit Exceeded):
def insert(S, string):
    S.add(string)

def find(S, string):
    cnt = 0
    for i in range(len(S)):
        cnt = cnt + 1
        if string in S:
            print 'yes'
            break
        elif cnt == len(S):
            print 'no'
    if cnt == 0:
        print 'no'

n = input()

S = set([])

for i in range(n):
    tmp1, tmp2  = map(str,raw_input().split())
    if tmp1 == 'insert':
        insert(S, tmp2)
    elif tmp1 == 'find':
        find(S, tmp2)
    else:
        print 'error!'

Fixed submission:
def insert(S, string):
    S.add(string)

def find(S, string):
    if string in S:
        print 'yes'
    else:
        print 'no'

n = input()

S = set()

for i in range(n):
    tmp1, tmp2  = map(str, raw_input().split())
    if tmp1 == 'insert':
        insert(S, tmp2)
    elif tmp1 == 'find':
        find(S, tmp2)
    else:
        print 'error!'
Buggy python submission (verdict: Runtime Error):
import math

class Point:
    def __init__(self, num_x, num_y):
        self.x = num_x
        self.y = num_y

def kock(n, p1, p2):
    if n == 0:
        return
    
    s = Point((2 * p1.x + 1 * p2.x) / 3.0, (2 * p1.y + 1 * p2.y) / 3.0)
    t = Point((1 * p1.x + 2 * p2.x) / 3.0, (1 * p1.y + 2 * p2.y) / 3.0)
    u = Point(0, 0)
    u.x = (t.x - s.x) * math.cos(math.pi / 3) - (t.y - s.y) * math.cos(math.pi / 3) + s.x
    u.y = (t.x - s.x) * math.sin(math.pi / 3) - (t.y - s.y) * math.cos(math.pi / 3) + s.y

    kock(n - 1, p1, s)
    print "%f %f" % (s.x, s.y)
    kock(n - 1, s, u)
    print "%f %f" % (u.x, u.y)
    kock(n - 1, u, t)
    print "%f %f" % (t.x, t.y)
    kock(n - 1, t, p2)
    
n = input()

p1 = Point(0, 0)
p2 = Point(100, 0)

print "%f %f" % (p1.x, p1.y)
kock(n, p1, p2)
print "%f %f" % (p2.x, p2.y

Fixed submission:
import math

class Point:
    def __init__(self, num_x, num_y):
        self.x = num_x
        self.y = num_y

def kock(n, p1, p2):
    if n == 0:
        return

    s = Point(0, 0)
    t = Point(0, 0)
    u = Point(0, 0)

    s.x = (2 * p1.x + p2.x) / 3.0
    s.y = (2 * p1.y + p2.y) / 3.0
    t.x = (p1.x + p2.x * 2) / 3.0
    t.y = (p1.y + p2.y * 2) / 3.0
    u.x = (t.x - s.x) * math.cos(math.pi / 3) - (t.y - s.y) * math.sin(math.pi / 3) + s.x
    u.y = (t.x - s.x) * math.sin(math.pi / 3) + (t.y - s.y) * math.cos(math.pi / 3) + s.y

    kock(n - 1, p1, s)
    print "%.8f %.8f" % (s.x, s.y)
    kock(n - 1, s, u)
    print "%.8f %.8f" % (u.x, u.y)
    kock(n - 1, u, t)
    print "%.8f %.8f" % (t.x, t.y)
    kock(n - 1, t, p2)

n = input()

p1 = Point(0, 0)
p2 = Point(100, 0)

print "%.8f %.8f" % (p1.x, p1.y)
kock(n, p1, p2)
print "%.8f %.8f" % (p2.x, p2.y)
Buggy python submission (verdict: Runtime Error):
import math

x1, y1, x2, y2 = map(int, raw_input().split())

print math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)

Fixed submission:
import math

x1, y1, x2, y2 = map(float, raw_input().split())

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

n = input()
while n != 0:
    if n == 0:
        break
    tmp = map(float, raw_input().split())
    sum = 0
    for i in xrange(len(tmp)):
        sum += tmp[i]
    ave = sum / n
    u = 0
    for i in xrange(n):
        u += (tmp[i] - ave)**2
    u = u / n
    print "%.8f" % math.sqrt(u)
    n = input()
~               

Fixed submission:
import math

n = input()
while n != 0:
    if n == 0:
        break
    tmp = map(float, raw_input().split())
    ave = 0
    for i in xrange(len(tmp)):
        ave += tmp[i] / n
    u = 0
    for i in xrange(n):
        u += (tmp[i] - ave)**2
    print "%.8f" % math.sqrt(u/n)
    n = input()
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
s = raw_input();

k = u = p = c = 0;
for a in s:
    if a == 'K':
        k += 1;
    if a == 'U':
        u += 1;
    if a == 'P':
        p += 1;
    if a == 'C':
        c += 1;

print min(k,u,p,c);

Fixed submission:
# coding: utf-8
s = raw_input();

k = u = p = c = 0;
for a in s:
    if a == 'K':
        k += 1;
    if a == 'U':
        u += 1;
    if a == 'P':
        p += 1;
    if a == 'C':
        c += 1;

print min(k,u,p,c);
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
print((a // abs(a)) * (b // abs(b)) * (abs(a) // abs(b)))



Fixed submission:
a, b = map(int, input().split())
print(((a // abs(a)) if a != 0 else 1)* (b // abs(b)) * (abs(a) // abs(b)))
Buggy python submission (verdict: Runtime Error):
def func (x):
	if x:
		return int(x)*func(x-1)
	else:
		return (1)
def comb (x,y):
	return func(x)//func(x-y)//func(y)

w,h,ax,ay,bx,by=map(int,input().split())
dx=min(w-abs(ax-bx),abs(ax-bx))
dy=min(h-abs(ay-by),abs(ay-by))
ans=1
if dx*2==w:ans*=2
if dy*2==h:ans*=2
ans*=comb(dx+dy,dx)
print(ans%100000007)

Fixed submission:
from math import factorial
def comb (x,y):
	return factorial(x)//factorial(x-y)//factorial(y)

w,h,ax,ay,bx,by=map(int,input().split())
dx=abs(ax-bx)
dx=min(dx,w-dx)
dy=abs(ay-by)
dy=min(dy,h-dy)
an=1
if dx*2==w:an*=2
if dy*2==h:an*=2
an*=comb(dx+dy,dx)
print(an%int(1E8+7))

Buggy python submission (verdict: Runtime Error):
import math
def comb (x,y):
	return factorial(x)//factorial(x-y)//factorial(y)

w,h,ax,ay,bx,by=map(int,input().split())
dx=min(w-abs(ax-bx),abs(ax-bx))
dy=min(h-abs(ay-by),abs(ay-by))
ans=1
if dx*2==w:ans*=2
if dy*2==h:ans*=2
ans*=comb(dx+dy,dx)
print(ans%100000007)

Fixed submission:
from math import factorial
def comb (x,y):
	return factorial(x)//factorial(x-y)//factorial(y)

w,h,ax,ay,bx,by=map(int,input().split())
dx=abs(ax-bx)
dx=min(dx,w-dx)
dy=abs(ay-by)
dy=min(dy,h-dy)
an=1
if dx*2==w:an*=2
if dy*2==h:an*=2
an*=comb(dx+dy,dx)
print(an%int(1E8+7))