Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
while True:
    c =0
    a = int(input())
    me = 1000 -a
    while me != 0:
     if me >= 500:
        me -= 500 
        c +=1 
     elif me >= 100:
        me -= 100 
        c +=1
     elif me >= 50:
        me -= 50
        c+=1
     elif me >= 10:
        me -= 10
        c +=1
     elif me >= 5:
        me -= 5
        c +=1
     elif me >= 1:
        me -= 1
        c+=1
       
       
     
     
    print c

Fixed submission:
while True:
  c =0
  a = int(input())
  if a == 0:break
  else:
    me = 1000 -a
    while me != 0:
     if me >= 500:
        me -= 500 
        c +=1 
     elif me >= 100:
        me -= 100 
        c +=1
     elif me >= 50:
        me -= 50
        c+=1
     elif me >= 10:
        me -= 10
        c +=1
     elif me >= 5:
        me -= 5
        c +=1
     elif me >= 1:
        me -= 1
        c+=1
       
       
     
     
    print c
Buggy python submission (verdict: Runtime Error):
while True:
  a = map(int,raw_input().split())
  print a[0]+a[1]

Fixed submission:
while True:
 try:
  a = map(int,raw_input().split())
  print a[0]+a[1]
 except EOFError:
   break
Buggy python submission (verdict: Runtime Error):
list = []
for i in range(0,3):
  n = int(raw_input())
  list.append(n)

list.sort()
for i in range(0,3):
  print list[i]

Fixed submission:
list= []
a,b,c = map(int,raw_input().split())
list.append(a)
list.append(b)
list.append(c)


list.sort()
print list[0],list[1],list[2]
Buggy python submission (verdict: Runtime Error):
R = raw_input ( )
print ( "%f %f" % ( float ( R ) * float ( R ) * math.pi , float ( R ) * 2 * math.pi ) )

Fixed submission:
import math
R = raw_input ( )
print ( "%f %f" % ( float ( R ) * float ( R ) * math.pi , float ( R ) * 2 * math.pi ) )
Buggy python submission (verdict: Runtime Error):
A , B = input ( ) .split ( ' ' )
print ( int ( A ) * int ( B ) , end = ' ')
print ( 2 * ( int ( A ) + int ( B ) ) )

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

Buggy python submission (verdict: Runtime Error):
A , B = input ( ).split ( ' ' )
print ( int ( A ) * int ( B ) , end = " " )
print ( 2 * ( int ( A ) + int ( B ) ) )

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

Buggy python submission (verdict: Runtime Error):
A , B = input ( ).split ( ' ' )
print ( int ( A ) * int ( B ) ) ,
print ( 2 * ( int ( A ) + int ( B ) ) )

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

Buggy python submission (verdict: Runtime Error):
A , B = input ( ).split ( ' ' )
print ( int ( A ) * int ( B ) ) ,
print ( 2 * ( int ( A ) + int ( B ) ) )

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

Buggy python submission (verdict: Runtime Error):
A , B = input ( ).split ( ' ' )
print int ( A ) * int ( B )
print 2 * ( int ( A ) + int ( B ) )

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

Buggy python submission (verdict: Runtime Error):
A , B = map ( int , input ( ).split ( ) )
print ( int ( A ) * int ( B ) , end = " " )
print ( 2 * ( int ( A ) + int ( B ) ) )

Fixed submission:
A , B = map ( int , raw_input ( ).split ( ) )
print A*B , 2* ( A + B )
Buggy python submission (verdict: Runtime Error):
a , b = map ( int , raw_input.split ( ) )
if a > b :
    print a , ">" , b
if a < b :
    print a , "<" , b
if a == b :
    print a , "==" , b

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

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

Fixed submission:
a , b = map ( int , raw_input ( ) .split ( ) )
if a > b :
    print "a > b"
if a < b :
    print "a < b"
if a == b :
    print "a == b"
Buggy python submission (verdict: Runtime Error):
cases = 1
while ( num = raw_input ( ) ) != 0 :
    print "Case " , cases , ": " , num

Fixed submission:
cases = 1
while True :
    num = raw_input ( )
    if int ( num ) == 0 :
        break
    print "Case %d: %d" % ( int ( cases ) , int ( num ) )
    cases += 1

Buggy python submission (verdict: Runtime Error):
cases = 1
while num = raw_input ( ) != 0 :
    print "Case " , cases , ": " , num

Fixed submission:
cases = 1
while True :
    num = raw_input ( )
    if int ( num ) == 0 :
        break
    print "Case %d: %d" % ( int ( cases ) , int ( num ) )
    cases += 1

Buggy python submission (verdict: Runtime Error):
cases = 1
while True :
    num = raw_input ( )
    if int ( num ) == 0 :
        break
    print "Case %d: %d" % ( cases , num )
    cases += 1
    

Fixed submission:
cases = 1
while True :
    num = raw_input ( )
    if int ( num ) == 0 :
        break
    print "Case %d: %d" % ( int ( cases ) , int ( num ) )
    cases += 1
Buggy python submission (verdict: Runtime Error):
numList = input ( ) .split ( " " )
numList = reversed ( numList )
for x in numList :
    print ( x , end = " " )

Fixed submission:
raw_input ( )
numList = raw_input ( ) .split ( " " )
numList = reversed ( numList )
for x in numList :
    print x ,

Buggy python submission (verdict: Runtime Error):
numList = raw_input ( ) .split ( " " )
numList = reversed ( numList )
for x in numList :
    print ( x , end = " " )

Fixed submission:
raw_input ( )
numList = raw_input ( ) .split ( " " )
numList = reversed ( numList )
for x in numList :
    print x ,
Buggy python submission (verdict: Runtime Error):
while True :
    A , B = input ( ) .split ( " " )
    A = int ( A )
    B = int ( B )
    if A == 0 and B == 0 :
        break
    for x in range ( A ) :
        for y in range ( B ) :
            print ( "#" , end = "" )
        print ( )

Fixed submission:
while True :
    A , B = raw_input ( ) .split ( " " )
    A = int ( A )
    B = int ( B )
    if A == 0 and B == 0 :
        break
    for x in range ( A ) :
       print "#" * B
    print

Buggy python submission (verdict: Runtime Error):
while True :
    A , B = input ( ) .split ( " " )
    A = int ( A )
    B = int ( B )
    if A == 0 and B == 0 :
        break
    for x in range ( A ) :
       print "#" * B

Fixed submission:
while True :
    A , B = raw_input ( ) .split ( " " )
    A = int ( A )
    B = int ( B )
    if A == 0 and B == 0 :
        break
    for x in range ( A ) :
       print "#" * B
    print

Buggy python submission (verdict: Runtime Error):
while True :
    A , B = input ( ) .split ( " " )
    A = int ( A )
    B = int ( B )
    if A == 0 and B == 0 :
        break
    for x in range ( A ) :
       print "#" * B + "\n"

Fixed submission:
while True :
    A , B = raw_input ( ) .split ( " " )
    A = int ( A )
    B = int ( B )
    if A == 0 and B == 0 :
        break
    for x in range ( A ) :
       print "#" * B
    print
Buggy python submission (verdict: Runtime Error):
raw_input ( )
numList = map ( int , raw_input ( ) .split ( ) )
raw_input ( )
quesList = map ( int , raw_input ( ) .split ( ) )
ans = 0
for x in quesList :
    if int ( x ) in numList :
        ans += 1
print ans

Fixed submission:
N = int ( raw_input ( ) )

numList = map ( int , raw_input ( ) .split ( ) )
numList = sorted ( numList )
for x in numList :
    print x ,
print
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding:utf-8 -*-

def main():
	PI = 3.14159265359
	r = int(raw_input())
	print ("%.8f %.8f"%(r**2*PI,r*2*PI))
	
if __name__ == '__main__':
	main()

Fixed submission:
#!/usr/bin/env python
# -*- coding:utf-8 -*-

def main():
	PI = 3.14159265359
	r = float(raw_input())
	print ("%.8f %.8f"%(r**2*PI,r*2*PI))
	
if __name__ == '__main__':
	main()
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

if __name__ == "__main__":
    import math
    a,b,c = map(int, raw_input().split())

    h = b * math.sin(math.pi * C / 180.0)
    S = h * a / 2.0
    L = math.sqrt((a - b * math.cos(math.pi * C / 180))**2 + h**2) + a + b
    
    print "%f" % S
    print "%f" % L
    print "%f" % h

Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

if __name__ == "__main__":
    import math
    a,b,c = map(int, raw_input().split())

    h = b * math.sin(math.pi * c / 180.0)
    S = h * a / 2.0
    L = math.sqrt((a - b * math.cos(math.pi * c / 180))**2 + h**2) + a + b
    
    print "%f" % S
    print "%f" % L
    print "%f" % h
Buggy python submission (verdict: Time Limit Exceeded):
while 1:
    n=input()
    if(n==0):break
    a=[]
    for i in range(n):
        a.append(input())
    ans=-100001
    for i in range(n):
        for j in range(i+1,n+1):
            ans=max(ans,sum(a[i:j]))
    print ans

Fixed submission:
while 1:
    n=input()
    if(n==0):break
    a=[]
    for i in range(n):
        a.append(input())
    s=[0]
    for i in range(n):
        s.append(s[-1]+a[i])
    ans=-100001
    for i in range(n):
        for j in range(i+1,n+1):
            ans=max(ans,s[j]-s[i])
    print ans
Buggy python submission (verdict: Runtime Error):
while 1:
        n = input()
        if n == 0: break
        ns=""
        for i in range(n):
                if i == 0: ns = str(input())
                temp = ''
                count = 1
                for j in range(len(ns)-1):
                        if ns[j] == ns[j+1]:
                                count += 1
                        else:
                                temp += str(count)+ns[j]
                                count = 1
                temp += str(count)+ns[-1]
                ns = temp
        print ns

Fixed submission:
while 1:
        n = input()
        if n == 0: break
        ns=""
        for i in range(n):
                if i == 0: ns = raw_input()
                temp = ''
                count = 1
                for j in range(len(ns)-1):
                        if ns[j] == ns[j+1]:
                                count += 1
                        else:
                                temp += str(count)+ns[j]
                                count = 1
                temp += str(count)+ns[-1]
                ns = temp
        print ns
Buggy python submission (verdict: Runtime Error):
magro = 0

saba = []
saba=map(int,raw_input().split(‘ ‘))
#print(“ika”)
ika=map(int,raw_input().split(‘ ‘))
print(max(sum(saba), sum(ika)))
neko = 0
hage = 90

Fixed submission:
magro = 0

saba = []
saba=map(int,raw_input().split(' '))
#print("ika")
ika=map(int,raw_input().split(' '))
print(max(sum(saba), sum(ika)))
neko = 0
hage = 90
Buggy python submission (verdict: Runtime Error):
def f(x):return 1if x<2else x*f(x-1)
print(f(int(input())))

Fixed submission:
def f(x): return 1 if x<2 else x*f(x-1)
print(f(int(input())))
Buggy python submission (verdict: Runtime Error):
#-------------------------------------------------------------------------------
# Name:        module1
# Purpose:
#
# Author:      sato
#
# Created:     19/10/2013
# Copyright:   (c) sato 2013
# Licence:     <your licence>
#-------------------------------------------------------------------------------

def input_and_sort():
    l = []
    for x in input():
        l.append(x)
    l.sort()
    return l



if __name__ == '__main__':
    l = input_and_sort()
    print l[0]
    print l[1]
    print l[2]

Fixed submission:
list = []
for x in range(10):
    y=input()
    list.append(y)
list = sorted(list)
list.reverse()
for x in range(3):
    print list[x]
Buggy python submission (verdict: Runtime Error):
def sort_cmp(x, y):
    if x[2] == y[2]:
        return x[3] < y[3]
    else:
        return x[2] > x[2]


def solve(n):
    teams = []
    for i in range(n):
        teams.append(list(map(int, input().split())))

    teams = sorted(teams, key=lambda x: -1e12 * x[2] + x[3] * 1e6 + x[0])

    A = []
    B = []
    threshold = 3
    for team in teams:
        if len(A) == 10:
            threshold = 2
        elif len(A) == 20:
            threshold = 1e8

        if B.count(team[1]) < threshold:
            A.append(team[0])
            B.append(team[1])

        if len(A) == 26:
            break

    for a in A:
        print(a)


while True:
    n = int(input())
    if n == 0:
        break
    solve(n)

Fixed submission:
def sort_cmp(x, y):
    if x[2] == y[2]:
        return x[3] < y[3]
    else:
        return x[2] > x[2]


def solve(n):
    teams = []
    for i in range(n):
        teams.append(list(map(int, raw_input().split())))

    teams = sorted(teams, key=lambda x: -1e12 * x[2] + x[3] * 1e6 + x[0])

    A = []
    B = []
    threshold = 3
    for team in teams:
        if len(A) == 10:
            threshold = 2
        elif len(A) == 20:
            threshold = 1

        if B.count(team[1]) < threshold:
            A.append(team[0])
            B.append(team[1])

        if len(A) == 26:
            break

    for a in A:
        print(a)


while True:
    n = int(raw_input())
    if n == 0:
        break
    solve(n)
Buggy python submission (verdict: Runtime Error):
h = [input() for _ in xrange(10)].sort()
h[0:3]

Fixed submission:
hs = [input() for _ in xrange(10)]
hs.sort()
for _ in xrange(3):
    print hs.pop()
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/python
# -*- coding: utf-8 -*-

import sys

if __name__ == '__main__':
    num = int(sys.argv[1])
    print num ** 3

Fixed submission:
n=input()
print n**3
Buggy python submission (verdict: Runtime Error):
import sys,math
for v in sys.stdin:
	print int(math.ceil(v**2/2/9.8/5))+1

Fixed submission:
import sys,math
for v in sys.stdin:
	print int(math.ceil(float(v)**2/2/9.8/5))+1
Buggy python submission (verdict: Runtime Error):
x, y = raw_input().split(' ')
print '{} {}'.format(x*y, (x+y)*2)

Fixed submission:
#!/usr/bin/env python

if __name__=='__main__':
    a, b = map(int, raw_input().split())
    print "{} {}". format(a*b, 2*(a+b))
Buggy python submission (verdict: Runtime Error):
def insertionSort(*args):
    l = list(args)
    for i in range(1, n):
        v = l[i]
        j = i - 1
        while j >= 0 and l[j] > v:
            l[j + 1] = l[j]
            j -= 1
            l[j + 1] = v
            print ' '.join(map(str, l))

n = input()
l = [input() for i in range(n)]
insertionSort(*l)

Fixed submission:
def insertionSort(*args):
    l = list(args)
    print ' '.join(map(str, l))
    for i in range(1, n):
        v = l[i]
        j = i - 1
        while j >= 0 and l[j] > v:
            l[j + 1] = l[j]
            j -= 1
            l[j + 1] = v
        print ' '.join(map(str, l))

n = input()
l = map(int, raw_input().split())
insertionSort(*l)
Buggy python submission (verdict: Runtime Error):
import math

l = [input() for x in range(4)]
dist = math.sqrt(math.fabs(l[0] - l[2])**2 + math.fabs(l[1] - l[3])**2)
print dist

Fixed submission:
import math

l = map(float, raw_input().split())
dist = math.sqrt((l[0] - l[2])**2 + (l[1] - l[3])**2)
print dist

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

l = [input() for x in range(4)]
dist = math.sqrt((l[0] - l[2])**2 + (l[1] - l[3])**2)
print dist

Fixed submission:
import math

l = map(float, raw_input().split())
dist = math.sqrt((l[0] - l[2])**2 + (l[1] - l[3])**2)
print dist
Buggy python submission (verdict: Runtime Error):
A=range(1,10)
for i in A:
   for j in A:
  print i,"x",j,"=",i*j

Fixed submission:
A=range(1,10)
for i in A:
 for j in A:
  print"%dx%d=%d"%(i,j,i*j)

Buggy python submission (verdict: Runtime Error):
A=range(1,10)
for i in A:
  for j in A:
  print i,"x",j,"=",i*j

Fixed submission:
A=range(1,10)
for i in A:
 for j in A:
  print"%dx%d=%d"%(i,j,i*j)
Buggy python submission (verdict: Runtime Error):
import sys
print(len(str(sum(map(int,s.split()))))) for s in sys.stdin:

Fixed submission:
import sys
for s in sys.stdin:print len(str(sum(map(int,s.split()))))

Buggy python submission (verdict: Runtime Error):
import sys
print(len(str(sum(map(int,s.split())))))　for s in sys.stdin

Fixed submission:
import sys
for s in sys.stdin:print len(str(sum(map(int,s.split()))))
Buggy python submission (verdict: Runtime Error):
for n in range(input()):
  a,b,c=sorted(map(int,raw_input().split()))
  print ["YES","NO"][c*c-a*a-b*b] 

Fixed submission:
m=["NO","YES"]
for n in range(input()):
  a,b,c=sorted(map(int,raw_input().split()))
  print m[c*c==a*a+b*b]
Buggy python submission (verdict: Runtime Error):
import sys
def gcm(a, b):
    if a<b: a,b=b,a
    if (a%b==0):
        return b
    else:
        return gcm(b,a%b)

for s in stdin:
    a,b=map(int,s.split())
    c=gcm(a,b)
    print "%d %d" %(c,a/c*b)

Fixed submission:
import sys
def g(a,b):
  x=g(b,a%b) if b else a
  return x
for s in sys.stdin:
  a,b=map(int,s.split())
  c=g(a,b)
  print c,a/c*b
Buggy python submission (verdict: Runtime Error):
import math

def get_primes(max_number):#return prime list smaller than max_number
    
    if max_number == 2:
        return [2]
    elif max_number < 3:
        return []
    
    numbers=range(1, max_number + 2, 2)
    nroot=math.floor(max_number ** 0.5)
    n=len(numbers)
    numbers[0]=0
    for i in range(1, n):
        x = numbers[i]
        if x > nroot:
            break
        if x and i + x < n:
            for j in range(i+x,n+1,x):
                numbers[j] = 0
    x=[2] + filter(None, numbers[1:])
    return x

n=[]
i=0
while (True):
    try:
        n.append([i,input(), 0])
        i+=1
    except:
        break

n=sorted(n, key=lambda x: x[1])
for i, e in enumerate(get_primes(n[-1][1])):
    for j in range(len(n)):
        if e<=n[j][1]:
            n[j][2]+=1

n=sorted(n, key=lambda x: x[0])
for e in n:
    print e[2]

Fixed submission:
import sys,math
def prime(m):
  N=range(1,m+2,2)
  r=int(m**.5)
  h=len(N)
  N[0]=0
  for i in range(h):
    x=N[i]
    if x>r:break
    if x and i+x<h:N[i+x:h:x]=[0]*((h-1-i-x)/x+1)
  N[0]=2
  return filter(None,N)
A=map(int,sys.stdin)
n=max(A)
B=[0]*(n+1)
i=0
c=0
for e in prime(n):
  while e>i:
    B[i]=c
    i+=1
  c+=1
  if i==n+1:break
else:
  for i in range(i,n+1):B[i]=c
for e in A:print B[e]

Buggy python submission (verdict: Time Limit Exceeded):
import sys,math
def prime(m):
  N=range(1,m+2,2)
  r=int(m**.5)
  h=len(N)
  N[0]=0
  for i in range(h):
    x=N[i]
    if x>r:break
    if x and i+x<h:N[i+x:h:x]=[0]*((h-1-i-x)/x+1)
  N[0]=2
  return filter(None,N)
A=map(int,sys.stdin)
n=max(A)+1
B=[0]*n
for e in prime(n):
  for i in range(e,n):B[i]+=1
for e in A:print B[e]

Fixed submission:
import sys,math
def prime(m):
  N=range(1,m+2,2)
  r=int(m**.5)
  h=len(N)
  N[0]=0
  for i in range(h):
    x=N[i]
    if x>r:break
    if x and i+x<h:N[i+x:h:x]=[0]*((h-1-i-x)/x+1)
  N[0]=2
  return filter(None,N)
A=map(int,sys.stdin)
n=max(A)
B=[0]*(n+1)
i=0
c=0
for e in prime(n):
  while e>i:
    B[i]=c
    i+=1
  c+=1
  if i==n+1:break
else:
  for i in range(i,n+1):B[i]=c
for e in A:print B[e]
Buggy python submission (verdict: Runtime Error):
import math

def equation(A):
    n = len(A)
    for i in range(n):
        j=i
        while A[j][i]==0:
            j+= 1
        A[i], A[j] = A[j], A[i]
        A[i] = [e / A[i][i] for e in A[i]]
        for j in range(n):
            if j==i: continue
            tmp = A[j][i]
            for k in range(n+1):
                A[j][k] -= tmp * A[i][k]
    return

def f003():
    n=input()
    A=[]
    for i in range(n):
        seq = map(float, raw_input().split())
        for j in range(3):
            x = seq.pop(0)
            y = seq.pop(0)
            A.append([x, y, 1, -(x**2+y**2)])
        equation(A)

        x0, y0 = -A[0][3]/2, -A[1][3]/2
        r =((x-x0)**2 + (y-y0)**2)**.5
    return x0,y0,r

x0,y0,r = f003()
print "%.3f %.3f %.3f" %(x0, y0, r)

Fixed submission:
import math
def equation(A):
  n=len(A)
  for i in range(n):
    j=i
    while A[j][i]==0:j+=1
    A[i],A[j]= A[j],A[i]
    A[i]=[e/A[i][i] for e in A[i]]
    for j in range(n):
      if j==i: continue
      tmp=A[j][i]
      for k in range(n+1):A[j][k]-=tmp*A[i][k]
  return
n=input()
for i in range(n):
  A=[]
  seq=map(float,raw_input().split())
  for j in range(0,6,2):
    x,y=seq[j:j+2]
    A+=[[x,y,1,-(x**2+y**2)]]
  equation(A)
  x0=-A[0][3]/2
  y0=-A[1][3]/2
  r=((x-x0)**2+(y-y0)**2)**.5
  print "%.3f %.3f %.3f" %(x0,y0,r)
Buggy python submission (verdict: Runtime Error):
import sys
def side(p1, p2, p3): return (p3[1]-p1[1])*(p2[0]-p1[0])-(p2[1]-p1[1])*(p3[0]-p1[0])>0
 
for s in sys.stdin:
  x = map(float, raw_input().split())
  p1 = x[0:2]
  p2 = x[2:4]
  p3 = x[4:6]
  p0 = x[6:]
  print ["NO","YES"][(side(p1, p2, p0)==side(p2, p3, p0) and side(p2, p3, p0)==side(p3, p1, p0))]

Fixed submission:
def side(p1, p2, p3):
    return (p3[1]-p1[1])*(p2[0]-p1[0])-(p2[1]-p1[1])*(p3[0]-p1[0])>0

while True:
    try:
        x = map(float, raw_input().split())
        p1 = x[0:2]
        p2 = x[2:4]
        p3 = x[4:6]
        p0 = x[6:]
        if (side(p1, p2, p0)==side(p2, p3, p0) and side(p2, p3, p0)==side(p3, p1, p0)):
            print "YES"
        else:
            print "NO"
    except:
        break
Buggy python submission (verdict: Runtime Error):
for e in sorted(map(int,input().split()))[::-1]:
    print e,
print

Fixed submission:
x=sorted(map(int,raw_input().split()))[::-1]
for e in x: print e,
Buggy python submission (verdict: Runtime Error):
import math
N=range(int(raw_input()))
for i in N:
    a,w,b,x,c,y,d,z=map(float, raw_input().split())
    print ["NO","YES"][(w-x)*(c-d)=(y-z)*(a-b)]

Fixed submission:
import math
for i in range(int(raw_input())):
    a,w,b,x,c,y,d,z=map(float, raw_input().split())
    print ["NO","YES"][abs((w-x)*(c-d)-(y-z)*(a-b))<1e-10]
Buggy python submission (verdict: Time Limit Exceeded):
while True:
    n = input()
    if n==0: break
    s=[]
    x=[]
    for i in range(n):
        x.append(input())
    for i in range(n):
        for j in range(i,n):
            s.append(sum(x[i:j+1]))
    print max(s)

Fixed submission:
n=input()
while n:
    x=-100000
    m=x
    s=0
    while n:
        x=input()+max(0,x)
        m=max(m,x)
        n-=1
    print m
    n=input()
Buggy python submission (verdict: Runtime Error):
import sys
def ink(x,y,size):
    global P
    P[y][x]+=1
    for d in [-1,1]:
        P[y+d][x]+=1
        P[y][x+d]+=1
    if size==1: return
    for d in [-1,1]:
        P[y+d][x+d]+=1
        P[y+d][x-d]+=1
    if size==2: return
    for d in [-2,2]:
        P[y+d][x]+=1
        P[y][x+d]+=1
    return

R=range(14)
A=[-1:1]
P=[[0 for i in R] for j in R]
for s in sys.stdin:
    x,y,size = map(int, s.split(","))
    ink(x+2,y+2,size)
c=0
m=0
for e in P[2:-2]:
    x=e[2:-2]
    c+=x.count(0)
    m=max(max(x),m)
print c
print m

Fixed submission:
import sys
def ink(x,y,s):
    global P
    P[y][x]+=1
    P[y+1][x]+=1
    P[y-1][x]+=1
    P[y][x+1]+=1
    P[y][x-1]+=1
    if s==1: return
    P[y+1][x+1]+=1
    P[y+1][x-1]+=1
    P[y-1][x+1]+=1
    P[y-1][x-1]+=1
    if s==2: return
    P[y+2][x]+=1
    P[y-2][x]+=1
    P[y][x+2]+=1
    P[y][x-2]+=1
    return

P=[[0]*14 for j in range(14)]
for s in sys.stdin:
    x,y,s = map(int, s.split(","))
    ink(x+2,y+2,s)
c=0
m=0
for e in P[2:-2]:
    x=e[2:-2]
    c+=x.count(0)
    m=max(max(x),m)
print c
print m
Buggy python submission (verdict: Runtime Error):
wd=["Mon","Tues","Wednes","Thurs","Fri","Satur","Sun"]
md=[0,31,29,31,30,31,30,31,31,30,31,30,31]

while 1:
    m,d = map(int, raw_input().split())
    if m==0: break
    s = sum([md[i] for i in range(month)]) + day + 2
    s = wd[s % 7]+"day"
    print s

Fixed submission:
wd=["Mon","Tues","Wednes","Thurs","Fri","Satur","Sun"]
md=[0,31,29,31,30,31,30,31,31,30,31,30,31]

while 1:
    m,d = map(int, raw_input().split())
    if m==0: break
    s = sum([md[i] for i in range(m)]) + d + 2
    s = wd[s % 7]+"day"
    print s
Buggy python submission (verdict: Runtime Error):
d=[0]*101

while True:
    try:
        n=input()
        d[n]+=1
    except:
        break

tmp=max(d)
for i in range(101):
    if d[i]=tmp: print i

Fixed submission:
import sys
n = 101
D = [0]*n

for s in sys.stdin: D[int(s)] += 1
tmp = max(D)
i = 0
for e in D:
    if e==tmp: print i
    i += 1