Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
from math import gcd
while True:
    try:
        a, b = map(int, input().split())
        print(gcd(a, b), a * b // gcd(a, b))
    except:
        break

Fixed submission:
def gcd(x,y):
    if y==0:
        return x
    return gcd(y,x%y)

while True:
    try:
        x,y=map(int,input().split())
    except:
        break
    print(gcd(x,y),x*y//gcd(x,y))

Buggy python submission (verdict: Runtime Error):
from math import gcd
while True:
    try:
        a,b=map(int,input().split())
        print(gcd(a,b),a*b//gcd(a,b))
    except:
        break

Fixed submission:
def gcd(x,y):
    if y==0:
        return x
    return gcd(y,x%y)

while True:
    try:
        x,y=map(int,input().split())
    except:
        break
    print(gcd(x,y),x*y//gcd(x,y))

Buggy python submission (verdict: Runtime Error):
from math import gcd
g=9.8
while True:
    try:
        a,b=map(int,input().split())
    except:
        break
    print(gcd(a,b),a*b//gcd(a,b))

Fixed submission:
def gcd(x,y):
    if y==0:
        return x
    return gcd(y,x%y)

while True:
    try:
        x,y=map(int,input().split())
    except:
        break
    print(gcd(x,y),x*y//gcd(x,y))

Buggy python submission (verdict: Runtime Error):
from math import gcd
while True:
    try:
        a,b=map(int,input().split())
    except:
        break
    print(gcd(a,b),a//gcd(a,b)*b)

Fixed submission:
def gcd(x,y):
    if y==0:
        return x
    return gcd(y,x%y)

while True:
    try:
        x,y=map(int,input().split())
    except:
        break
    print(gcd(x,y),x*y//gcd(x,y))
Buggy python submission (verdict: Runtime Error):
prime=[False]*1000000
np=[0]*1000000
for i in range(2,1000):
    if not prime[i]
    for j in range(i*2,1000000,i):
        prime[j]=True
        
while True:
    try:
        n=int(input())
    except:
        break
    print(sum(prime[2:n+1]))

Fixed submission:
prime=[True]*1000000
for i in range(2,1000):
    if prime[i]:
        for j in range(i*2,1000000,i):
            prime[j]=False

while True:
    try:
        n=int(input())
    except:
        break
    print(sum(prime[2:n+1]))

Buggy python submission (verdict: Runtime Error):
prime=[False]*1000000
np=[0]*1000000
for i in range(2,1000):
    if not prime[i]
    for j in range(i*2,1000000,i):
        prime[j]=True

while True:
    try:
        n=int(input())
    except:
        break
    print(sum(prime[2:n+1]))

Fixed submission:
prime=[True]*1000000
for i in range(2,1000):
    if prime[i]:
        for j in range(i*2,1000000,i):
            prime[j]=False

while True:
    try:
        n=int(input())
    except:
        break
    print(sum(prime[2:n+1]))
Buggy python submission (verdict: Runtime Error):
a=sorted([int(i) for i in input().split()],reverse=True)
print(",".join(a))

Fixed submission:
print(*sorted([int(i) for i in input().split()],reverse=True))

Buggy python submission (verdict: Runtime Error):
print(" ".join(sorted([int(i) for i in input().split()], reverse = True)))

Fixed submission:
print(*sorted([int(i) for i in input().split()],reverse=True))
Buggy python submission (verdict: Runtime Error):
v=int(input())
f=2
g=9.8
while True:
    F=f*5-5
    if sqrt(2*g*F)>=v:
        print(f)
        break
    f+=1

Fixed submission:
from math import sqrt
g=9.8
while True:
    try:
        v=float(input())
    except:
        break
    f=2
    while True:
        F=f*5-5
        if sqrt(2*g*F)>=v:
            print(f)
            break
        f+=1

Buggy python submission (verdict: Runtime Error):
from math import sqrt
v=int(input())
f=2
g=9.8
while True:
    F=f*5-5
    if sqrt(2*g*F)>=v:
        print(f)
        break
    f+=1

Fixed submission:
from math import sqrt
g=9.8
while True:
    try:
        v=float(input())
    except:
        break
    f=2
    while True:
        F=f*5-5
        if sqrt(2*g*F)>=v:
            print(f)
            break
        f+=1
Buggy python submission (verdict: Runtime Error):
ans=0
def solve(n,left,right):
    if n==10:
        ans=1
    else:
        if a[n]>left:
            ans=solve(n+1,a[n],right)
        if a[n]>right:
            ans=solve(n+1,left,a[n])
    return ans

n=int(input())
for _ in range(n):
    a=[int(i) for i in input().split()]
    print("YES" if solve(0,0,0) else "NO")
    

Fixed submission:
ans=0
def solve(n,left,right):
    global ans
    if n==10:
        ans=1
    else:
        if a[n]>left:
            ans=solve(n+1,a[n],right)
        if a[n]>right:
            ans=solve(n+1,left,a[n])
    return ans

n=int(input())
for _ in range(n):
    a=[int(i) for i in input().split()]
    print("YES" if solve(0,0,0) else "NO")
    ans=0
Buggy python submission (verdict: Runtime Error):
nums={"I":1,"V":5,"X":10,"L":50,"C":100,"D":500,"M":1000}
while True:
    try:
        s=input()
    except:
        break
    ans=nums[s[0]]
    for i in range(len(s)):
        if num[s[i-1]]<num[s[i]]:
            ans+=num[s[i]]-2*num[s[i-1]]
        else:
            ans+=num[s[i]]
    print(ans)
        

Fixed submission:
nums={"I":1,"V":5,"X":10,"L":50,"C":100,"D":500,"M":1000}
while True:
    try:
        s=input()
    except:
        break
    ans=nums[s[0]]
    for i in range(1,len(s)):
        if nums[s[i-1]]<nums[s[i]]:
            ans-=2*nums[s[i-1]]
        ans+=nums[s[i]]
    print(ans)

Buggy python submission (verdict: Runtime Error):
nums={"I":1,"V":5,"X":10,"L":50,"C":100,"D":500,"M":1000}
while True:
    try:
        s=input()
    except:
        break
    ans=nums[s[0]]
    for i in range(1,len(s)):
        if num[s[i-1]]<num[s[i]]:
            ans+=num[s[i]]-2*num[s[i-1]]
        else:
            ans+=num[s[i]]
    print(ans)
        

Fixed submission:
nums={"I":1,"V":5,"X":10,"L":50,"C":100,"D":500,"M":1000}
while True:
    try:
        s=input()
    except:
        break
    ans=nums[s[0]]
    for i in range(1,len(s)):
        if nums[s[i-1]]<nums[s[i]]:
            ans-=2*nums[s[i-1]]
        ans+=nums[s[i]]
    print(ans)
Buggy python submission (verdict: Runtime Error):
times=0
while True:
    times+=1
    W=int(input())
    n=int(input())
    if W==0:
        break
    w=[0]*n
    v=[0]*n
    for i in range(n):
        v[i],w[i]=map(int,input().split(","))
    dp=[[0]*(W+1) for i in range(n+1)]
    for i in range(n):
        for j in range(W+1):
            if j<w[i]:
                dp[i+1][j]=dp[i][j]
            else:
                dp[i+1][j]=max(dp[i][j],dp[i][j-w[i]]+v[i])
    MIN=0
    for i in range(W+1):
        if dp[n][i]==dp[n][W]:
            MIN=i
            break
    print("Case %d:"%times)
    print(dp[n][W])
    print(MIN)

Fixed submission:
cnt=0
while True:
    cnt+=1
    W=int(input())
    if W==0:
        break
    n=int(input())
    dp=[0]*(W+1)
    for i in range(n):
        v,w=map(int,input().split(','))
        for j in range(W,w-1,-1):
            dp[j]=max(dp[j],dp[j-w]+v)
    wgt=0
    md=max(dp)
    for i in range(W+1):
        if md==dp[i]:
            wgt=i
            break
    print("Case {0}:".format(cnt))
    print(md)
    print(wgt)
Buggy python submission (verdict: Runtime Error):
flag = False
cli = [0] * 1000
sen = set()
kon = set()
while True:
    try:
        c, d = map(int, input().split(","))
    except:
        if flag:
            break
        flag = True
        continue
    if flag:
        kon.add(c)
    else:
        sen.add(c)
    cli[c] += 1

for i in range(1,1001):
    if i in sen and i in kon:
        print(i,cli[i])

Fixed submission:
x = 0
cli = [[0] * 2 for i in range(1001)]

while True:
    try:
        c, d = map(int, input().split(","))
    except:
        if x == 1:
            break
        x += 1
        continue
    cli[c][x] += 1

for i in range(1,1001):
    if(cli[i][0] and cli[i][1]):
        print(i, cli[i][0] + cli[i][1])
Buggy python submission (verdict: Runtime Error):
def bfs(maze):
    d = [[0] * 70 for i in range(70)]
    d[1][1] = 1
    que = [(1, 1)]
    while 0 < len(que):
        new_que = []
        for x, y in que:
            if x == 2 * w - 1 and y == 2 * h - 1:
                return d[y][x]
            for dx, dy in ((0, 1), (-1, 0), (0, -1), (1, 0)):
                mx, my = x + dx, y + dy
                nx, ny = mx + dx, my + dy
                if nx < 0 and w < nx and ny < 0 and h < ny:
                    continue
                if maze[my][mx] == 0 and d[ny][nx] == 0:
                    new_que.append((nx, ny))
                    d[ny][nx] = d[y][x] + 1
        que = new_que
    return 0

while True:
    w, h = map(int, input().split())
    maze = [[0] * (w * 2) for i in range(h * 2)]
    if w == h == 0:
        break
    for x in range(w * 2 + 1):
        maze[0][x] = maze[h * 2][x] = 1
    for y in range(h * 2 + 1):
        maze[y][0] = maze[y][w * 2] = 1

    for y in range(1, h * 2):
        a = [int(i) for i in input().split()]
        if y % 2 == 1:
            for x in range(w - 1):
                maze[y][2 * x + 2] = a[x]
        else:
            for x in range(w):
                maze[y][2 * x + 1] = a[x]

    print(bfs(maze))

Fixed submission:
def bfs(maze):
    d = [[0] * 65 for i in range(65)]
    d[1][1] = 1
    que = [(1, 1)]
    while que:
        x, y = que.pop(0)
        if x == 2 * w - 1 and y == 2 * h - 1:
            return d[y][x]
        for dx, dy in ((0, 1), (-1, 0), (0, -1), (1, 0)):
            mx, my = x + dx, y + dy
            nx, ny = mx + dx, my + dy
            if nx < 0 and w < nx and ny < 0 and h < ny:
                continue
            if maze[my][mx] == 0 and d[ny][nx] == 0:
                que.append((nx, ny))
                d[ny][nx] = d[y][x] + 1
    return 0

while True:
    w, h = map(int, input().split())
    maze = [[0] * 65 for i in range(65)]
    if w == h == 0:
        break
    for x in range(w * 2 + 1):
        maze[0][x] = maze[h * 2][x] = 1
    for y in range(h * 2 + 1):
        maze[y][0] = maze[y][w * 2] = 1

    for y in range(1, h * 2):
        a = [int(i) for i in input().split()]
        if y % 2 == 1:
            for x in range(w - 1):
                maze[y][2 * x + 2] = a[x]
        else:
            for x in range(w):
                maze[y][2 * x + 1] = a[x]

    print(bfs(maze))
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
s=""
if a>b:
    s=">"
elif e<b:
    s="<"
else:
    s="=="
print("a",s,"b")

Fixed submission:
a,b=map(int,input().split())
s=""
if a>b:
    s=">"
elif a<b:
    s="<"
else:
    s="=="
print("a",s,"b")
Buggy python submission (verdict: Runtime Error):
while (1):
	edges = list(map(int, input().split()))
	if len(edges) == 0:
		break
	edges.sort()

	if edges[0] ** 2 + edges[1] ** 2 == edges[2] ** 2:
		print("YES")
	else:
		print("NO")

Fixed submission:
n = int(input())
for _ in range(n):
	edges = list(map(int, input().split()))
	if len(edges) == 0:
		break
	edges.sort()

	if edges[0] ** 2 + edges[1] ** 2 == edges[2] ** 2:
		print("YES")
	else:
		print("NO")
Buggy python submission (verdict: Runtime Error):
import sys

def bubble_sort(C, N):
	for i in range(N):
		for j in range(N - 1, i, -1):
			if C[j][1] < C[j - 1][1]:
				C[j], C[j - 1] = C[j - 1], C[j]
				
	return C

def	selection_sort(C, N):
	for i in range(N):
		minj = i
		for j in range(i, N):
			if C[j][1] < C[minj][1]:
				minj = j

		C[i], C[minj] = C[minj], C[i]
	
	return C

fin = open("test.txt", "r")
#fin = sys.stdin

N = int(fin.readline())
A = fin.readline().split()
B = A[:]

A = bubble_sort(A, N)
B = selection_sort(B, N)

print(" ".join(A))
print("Stable")

print(" ".join(B))
if A == B:
	print("Stable")
else:
	print("Not stable")

Fixed submission:
import sys

def bubble_sort(C, N):
	for i in range(N):
		for j in range(N - 1, i, -1):
			if C[j][1] < C[j - 1][1]:
				C[j], C[j - 1] = C[j - 1], C[j]
				
	return C

def	selection_sort(C, N):
	for i in range(N):
		minj = i
		for j in range(i, N):
			if C[j][1] < C[minj][1]:
				minj = j

		C[i], C[minj] = C[minj], C[i]
	
	return C

#fin = open("test.txt", "r")
fin = sys.stdin

N = int(fin.readline())
A = fin.readline().split()
B = A[:]

A = bubble_sort(A, N)
B = selection_sort(B, N)

print(" ".join(A))
print("Stable")

print(" ".join(B))
if A == B:
	print("Stable")
else:
	print("Not stable")
Buggy python submission (verdict: Runtime Error):
import sys
import math 

def be_able_to_convey(w, k, p):
	counter = 0
	cur_weight = 0
	for wi in w:
		if wi > p:
			return False

		cur_weight += wi
		if(cur_weight > p):
			cur_weight = wi
			counter += 1
			if(counter >= k):
				return False

	return True

fin = open("test.txt", "r")
#fin = sys.stdin

n, k = map(int, fin.readline().split())
w = [0 for i in range(n)]
w_max = 0

for i in range(n):
	w[i] = int(fin.readline())
	w_max = max(w[i], w_max)
	

pmin = 1
pmax = math.ceil(w_max * w_max // k)

while pmin < pmax:
	p = math.ceil((pmin + pmax) / 2)
	if p == pmin or p == pmax:
		if be_able_to_convey(w, k, pmax):
			if be_able_to_convey(w, k, pmin):
				p = pmin
			else:
				p = pmax
		else:
			p = pmin
		break

	if not be_able_to_convey(w, k, p):
		pmin = p
	else:
		pmax = p

print(p)

Fixed submission:
import sys
import math 

def be_able_to_convey(w, k, p):
	counter = 0
	cur_weight = 0
	for wi in w:
		if wi > p:
			return False

		cur_weight += wi
		if(cur_weight > p):
			cur_weight = wi
			counter += 1
			if(counter >= k):
				return False

	return True

#fin = open("test.txt", "r")
fin = sys.stdin

n, k = map(int, fin.readline().split())
w = [0 for i in range(n)]

for i in range(n):
	w[i] = int(fin.readline())
	
pmin = 1
pmax = int(10e9)

while pmin < pmax:
	p = math.ceil((pmin + pmax) / 2)
	if p == pmin or p == pmax:
		if be_able_to_convey(w, k, pmin):
			p = pmin
		else:
			#if not be_able_to_convey(w, k, pmax):
			#	print("error")
			p = pmax
		break

	if not be_able_to_convey(w, k, p):
		pmin = p
	else:
		pmax = p

print(p)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import itertools

def can_be_composed(n, m, A):
	for i in range(1, n + 1):
		combination_list = list(itertools.combinations(A, i))
		for l in combination_list:
			if m == sum(l):
				return True

	return False

#fin = open("test.txt", "r")
fin = sys.stdin

n = int(fin.readline())
A = list(map(int, fin.readline().split()))
q = int(fin.readline())
m_list = list(map(int, fin.readline().split()))
for m in m_list:
	if can_be_composed(n, m, A):
		print("yes")
	else:
		print("no")

Fixed submission:
import sys
#fin = open("test.txt", "r")
fin = sys.stdin

n = int(fin.readline())
A = list(map(int, fin.readline().split()))
q = int(fin.readline())
m_list = list(map(int, fin.readline().split()))

for m in m_list:
	can_compose = False
	s = [[] for i in range(n)] #s[i][m]??§???A[i]?????§???????´???§m????????????????????????????????????
	for i in range(n):
		s[i] = [False for i in range(m + 1)]

	for j in range(m + 1):
		if j == A[0]:
			s[0][j] = True
		else:
			s[0][j] = False
		
	if s[0][m]:
		can_compose = True
		
	if not can_compose:
		for i in range(1, n):
			for j in range(m + 1):
				if j == A[i]:
					s[i][j] = True
				elif s[i - 1][j]:
					s[i][j] = True
				else:
					if j - A[i] >= 0:
						s[i][j] = s[i - 1][j - A[i]]
			
			if s[i][m]:
				can_compose = True
				break

	if can_compose:
		print("yes")
	else:
		print("no")
Buggy python submission (verdict: Runtime Error):
import math

r = int(input())

s = math.pi * r ** 2 
l = 2 * math.pi * r

print("{0:.6f} {1:.6f}".format(s, l))

Fixed submission:
import math

r = float(input())

s = math.pi * r ** 2 
l = 2 * math.pi * r

print("{0:.6f} {1:.6f}".format(s, l))
Buggy python submission (verdict: Runtime Error):
import sys

#fin = open("test.txt", "r")
fin = sys.stdin

n, m = map(int, fin.readline().split())

A = [[] for i in range(n)]
for i in range(n):
	A[i] = list(map(int, fin.readline().split()))

b = [0 for i in range(m)]

for i in range(m):
	b[i] = int(fin.readline())

c = [0 for i in range(m)]

for i in range(n):
	for j in range(m):
		c[i] += A[i][j] * b[j]

for i in range(n):
	print(c[i])

Fixed submission:
import sys

#fin = open("test.txt", "r")
fin = sys.stdin

n, m = map(int, fin.readline().split())

A = [[] for i in range(n)]
for i in range(n):
	A[i] = list(map(int, fin.readline().split()))

b = [0 for i in range(m)]

for i in range(m):
	b[i] = int(fin.readline())

c = [0 for i in range(n)]

for i in range(n):
	for j in range(m):
		c[i] += A[i][j] * b[j]

for i in range(n):
	print(c[i])
Buggy python submission (verdict: Runtime Error):
import sys

#fin = open("test.txt", "r")
fin = sys.stdin

while True:
	[m, f, r] = list(map(int, fin.readline().split()))

	if m == -1 and f == -1 and r == -1:
		break

	sum_mf = m + f
	if m == -1 or f == -1:
		print("F")
	elif sum_mf >= 80:
		print("A")
	elif sum_mf >= 65:
		print("B")
	elif sum_mf >= 50:
		print("C")
	elif sum_mf >= 30:
		if r >= 50:
			print("C")
		else:
			print("D")
	else:
		print("F")

Fixed submission:
import sys

#fin = open("test.txt", "r")
fin = sys.stdin

while True:
	[n, x] = list(map(int, fin.readline().split()))

	if n == 0 and x == 0:
		break

	counter = 0
	for i in range(1, n + 1):
		for j in range(i + 1, n + 1):
			for k in range(j + 1, n + 1):
				if i + j + k == x:
					counter += 1

	print(counter)
Buggy python submission (verdict: Runtime Error):
heights = list()
for i in range(10):
    heights.append(int(input()))
for height in reversed(sorted(heights))[:3]:
    print(height)

Fixed submission:
heights = list()
for i in range(10):
    heights.append(int(input()))
for height in list(reversed(sorted(heights)))[:3]:
    print(height)
Buggy python submission (verdict: Runtime Error):
while True:
    line = input()
    if not line:
        break
    a, b = map(int, line.split())
    print(a + b)

Fixed submission:
while True:
    try:
        line = input()
    except EOFError:
        break
    s = sum(map(int, line.split()))
    num = 0
    for c in str(s):
        if c.isdigit():
            num += 1
    print(num)

Buggy python submission (verdict: Runtime Error):
while True:
    try:
        line = input()
    except IOError:
        break
    a, b = map(int, line.split())
    print(a + b)

Fixed submission:
while True:
    try:
        line = input()
    except EOFError:
        break
    s = sum(map(int, line.split()))
    num = 0
    for c in str(s):
        if c.isdigit():
            num += 1
    print(num)

Buggy python submission (verdict: Runtime Error):
while True:
    try:
        line = input()
    except EOFError:
        break
    for c in line:
        print(len(filter(lambda c: c in '123456789', line)))

Fixed submission:
while True:
    try:
        line = input()
    except EOFError:
        break
    s = sum(map(int, line.split()))
    num = 0
    for c in str(s):
        if c.isdigit():
            num += 1
    print(num)

Buggy python submission (verdict: Runtime Error):
while True:
    try:
        line = input()
    except EOFError:
        break
    print(len(filter(lambda c: c in '123456789', line)))

Fixed submission:
while True:
    try:
        line = input()
    except EOFError:
        break
    s = sum(map(int, line.split()))
    num = 0
    for c in str(s):
        if c.isdigit():
            num += 1
    print(num)

Buggy python submission (verdict: Runtime Error):
while True:
    try:
        line = input()
    except EOFError:
        break
    s = sum(map(int, line.split()))
    num = 0
    for c in s:
        if c.isdigit():
            num += 1
    print(num)

Fixed submission:
while True:
    try:
        line = input()
    except EOFError:
        break
    s = sum(map(int, line.split()))
    num = 0
    for c in str(s):
        if c.isdigit():
            num += 1
    print(num)
Buggy python submission (verdict: Runtime Error):
def is_triangle(x, y, z):
    x, y, z = sorted(x, y, z)
    return x**2 + y**2 == z**2

num = int(input())
for i in range(num):
    x, y, z = map(int, input().split())
    triangle = is_triangle(x, y, z)
    if triangle:
        print('YES')
    else:
        print('NO')
        

Fixed submission:
def is_triangle(x, y, z):
    x, y, z = sorted([x, y, z])
    return x**2 + y**2 == z**2

num = int(input())
for i in range(num):
    x, y, z = map(int, input().split())
    triangle = is_triangle(x, y, z)
    if triangle:
        print('YES')
    else:
        print('NO')

Buggy python submission (verdict: Runtime Error):
def is_triangle(x, y, z):
    x, y, z = sorted(x, y, z)
    return x**2 + y**2 == z**2

num = int(input())
for i in range(num):
    x, y, z = map(int, input().split())
    triangle = is_triangle(x, y, z)
    if triangle:
        print('YES')
    else:
        print('NO')
        

Fixed submission:
def is_triangle(x, y, z):
    x, y, z = sorted([x, y, z])
    return x**2 + y**2 == z**2

num = int(input())
for i in range(num):
    x, y, z = map(int, input().split())
    triangle = is_triangle(x, y, z)
    if triangle:
        print('YES')
    else:
        print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
# input
n = int(input())
R = []
for i in range(n):
    R.append(int(input()))

# calc
maximum = -10**9
for i in range(n):
    for j in range(i+1, n):
        if R[j] - R[i] > maximum:
            maximum = R[j] - R[i]

# output
print(maximum)

Fixed submission:
n = int(input())
max_diff = -10**10

current_min = int(input())

for _ in range(n-1):
    current = int(input())
    diff = current - current_min
    if diff > max_diff:
        max_diff = diff
    if current < current_min:
        current_min = current
print(max_diff)
Buggy python submission (verdict: Runtime Error):
from math import sqrt
x1, y1, x2, y2 = map(int, input().split())
r = sqrt((x2 - x1)**2 + (y2 - x2)**2)
print(r)

Fixed submission:
import math
x1, y1, x2, y2 = map(float, input().split())
print(math.sqrt((x2 - x1)**2 + (y2 -y1)**2))

Buggy python submission (verdict: Runtime Error):
from math import sqrt
x1, y1, x2, y2 = map(int, input().split())
r = sqrt((x2 - x1)**2 + (y2 - y1)**2)
print(r)

Fixed submission:
import math
x1, y1, x2, y2 = map(float, input().split())
print(math.sqrt((x2 - x1)**2 + (y2 -y1)**2))

Buggy python submission (verdict: Runtime Error):
from math import sqrt
x1, y1, x2, y2 = map(int, input().split())
r = sqrt((x2 - x1)**2 + (y2 - y1)**2)
print(r)

Fixed submission:
import math
x1, y1, x2, y2 = map(float, input().split())
print(math.sqrt((x2 - x1)**2 + (y2 -y1)**2))

Buggy python submission (verdict: Runtime Error):
from math import sqrt
x1, y1, x2, y2 = map(int, input().split())
r = sqrt((x2 - x1)**2 + (y2 - y1)**2)
print(r)

Fixed submission:
import math
x1, y1, x2, y2 = map(float, input().split())
print(math.sqrt((x2 - x1)**2 + (y2 -y1)**2))

Buggy python submission (verdict: Runtime Error):
from math import sqrt
x1, y1, x2, y2 = map(int, input().split())
r = sqrt((x2 - x1)**2 + (y2 - y1)**2)
print(r)

Fixed submission:
import math
x1, y1, x2, y2 = map(float, input().split())
print(math.sqrt((x2 - x1)**2 + (y2 -y1)**2))
Buggy python submission (verdict: Runtime Error):
import statistics
while True:
  input()
  print(statistics.stdev(map(int, input().split()))

Fixed submission:
import math

while True:
    n = int(input())
    if n == 0:
        break
    points = list(map(int, input().split()))

    m = sum(points) / n
    variance = sum(map(lambda x: (x - m) ** 2, points)) / n
    standard_deviation = math.sqrt(variance)
    print(standard_deviation)

Buggy python submission (verdict: Runtime Error):
import statistics
while True:
  n = input()
  if n == '0': break
  print(statistics.stdev(map(int, input().split())))

Fixed submission:
import math

while True:
    n = int(input())
    if n == 0:
        break
    points = list(map(int, input().split()))

    m = sum(points) / n
    variance = sum(map(lambda x: (x - m) ** 2, points)) / n
    standard_deviation = math.sqrt(variance)
    print(standard_deviation)

Buggy python submission (verdict: Runtime Error):
import statistics
while True:
  n = input()
  if n == '0': break
  print(statistics.stdev(map(int, input().split())))

Fixed submission:
import math

while True:
    n = int(input())
    if n == 0:
        break
    points = list(map(int, input().split()))

    m = sum(points) / n
    variance = sum(map(lambda x: (x - m) ** 2, points)) / n
    standard_deviation = math.sqrt(variance)
    print(standard_deviation)