Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
print(a + b)

Fixed submission:
a, b = input().split( )
a = int(a)
b = int(b)
print(str(a*b) + ' ' + str(2*(a+b)))

Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
print(a*b + ' ' + 2*(a+b))

Fixed submission:
a, b = input().split( )
a = int(a)
b = int(b)
print(str(a*b) + ' ' + str(2*(a+b)))

Buggy python submission (verdict: Runtime Error):
a, b = input().split
print(a??????b + ' ' + 2??????(a+b))

Fixed submission:
a, b = input().split( )
a = int(a)
b = int(b)
print(str(a*b) + ' ' + str(2*(a+b)))
Buggy python submission (verdict: Runtime Error):
i=1
while (True)
x = int(input())
if (x == 0)
   break
else
   print(Case %d:%d; i, x)
   i + 1 = i


Fixed submission:
i = 1
while True:
   x = int(input())
   if x == 0:
      break
   else:
      print("Case {}: {}".format(i,x))
      i += 1

Buggy python submission (verdict: Runtime Error):
i = 1
while True:
x = int(input())
if x==0:
   break
else:
   print("Case %d: %d".format(i,x))
   i += 1


Fixed submission:
i = 1
while True:
   x = int(input())
   if x == 0:
      break
   else:
      print("Case {}: {}".format(i,x))
      i += 1

Buggy python submission (verdict: Runtime Error):
i = 1
while True:
x = int(input())
if x == 0:
   break
else:
   print("Case %d: %d".format(i,x))
   i += 1



Fixed submission:
i = 1
while True:
   x = int(input())
   if x == 0:
      break
   else:
      print("Case {}: {}".format(i,x))
      i += 1
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())

count = 0
n = 0

while b-a==0:
   if c%(b-(a+n)==0
      count += 1 
      n += 1
   else:
      n += 1


Fixed submission:
a, b, c = map(int, input().split())

count = 0

for i in range(a, b+1):
   if c % i == 0:
      count += 1

print(count)

Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())

count = 1

for i in range(a, b+1):
   if c%i = 0:
      count += 1

print(count)


Fixed submission:
a, b, c = map(int, input().split())

count = 0

for i in range(a, b+1):
   if c % i == 0:
      count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())

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

print("{:d} {;d} {:.5f}".format(d, r, f))



Fixed submission:
a, b = map(int, input().split())

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

print("{:d} {:d} {:.5f}".format(d, r, f))
Buggy python submission (verdict: Runtime Error):
H, W = map(int, input().split())

if H == 0 and W == 0:
   break

print("#" * W)

for i in range(1, H-1):
   print("#", end = "")
   for j in range(1, W-1):
      print(".", end = "")
   print("#", end = "")

print("#" * W)

print("")


Fixed submission:
while True:
   H, W = map(int, input().split())

   if H == 0 and W == 0:
      break

   print("#" * W)

   for i in range(1, H-1):
      print("#" + "."*(W-2) + "#")

   print("#" * W)

   print("")
Buggy python submission (verdict: Runtime Error):
n = int(input())

remind = []
for i in range(n):
   remind.append(input())

egara = ["S ", "H ", "C ", "D "]
for i in range(4):
   for j in range(13):
      if egara[i]+ str(j) not in a:
         print(egara[i] + str(j))


Fixed submission:
n = int(input())

remind = []
for i in range(n):
   remind.append(input())

egara = ["S ", "H ", "C ", "D "]
for i in range(4):
   for j in range(1, 14):
      if egara[i] + str(j) not in remind:
         print(egara[i] + str(j))

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

remind = []
for i in range(n):
   remind.append(input())

egara = ["S ", "H ", "C ", "D "]
for i in range(4):
   for j in range(1, 14):
      if egara[i] + str(j) not in a:
         print(egara[i] + str(j))


Fixed submission:
n = int(input())

remind = []
for i in range(n):
   remind.append(input())

egara = ["S ", "H ", "C ", "D "]
for i in range(4):
   for j in range(1, 14):
      if egara[i] + str(j) not in remind:
         print(egara[i] + str(j))

Buggy python submission (verdict: Runtime Error):
n = int(input())
egara = ["S ", "H ", "C ", "D "]
remind = []
for i in range(n):
   remind.append(input())

for i in range(4):
   for j in range(1, 14):
      if egara[i] + str(j) not in a:
         print(egara[i] + str(j))


Fixed submission:
n = int(input())

remind = []
for i in range(n):
   remind.append(input())

egara = ["S ", "H ", "C ", "D "]
for i in range(4):
   for j in range(1, 14):
      if egara[i] + str(j) not in remind:
         print(egara[i] + str(j))
Buggy python submission (verdict: Runtime Error):
while True:
   m, f, r = map(int, input().split())
   if m+f+r = -3:
      break
   S = m + f
   if S >= 80:
      print("A")
   elif S >= 65 and S < 80:
      print("B")
   elif S >= 50 and S < 65:
      print("C")
   elif S >= 30 and S < 50:
      if m == -1 or f == -1:
         print("F")
      else:
         if r >= 50:
            print("C")
         else:
            print("D")
   else:
      print("F")




Fixed submission:
while True:
   m, f, r = map(int, input().split())
   if m == -1 and f == -1 and r == -1:
      break
   S = m + f
   if m == -1 or f == -1:
      print("F")
   elif S >= 80:
      print("A")
   elif S >= 65 and S < 80:
      print("B")
   elif S >= 50 and S < 65:
      print("C")
   elif S >= 30 and S < 50:
      if r >= 50:
         print("C")
      else:
         print("D")
   else:
      print("F")

Buggy python submission (verdict: Runtime Error):
while True:
   m, f, r = map(int, input().split())
   if m+f+r = -3:
      break
   if m == -1 or f == -1:
      print("F")
   S = m + f
   if S >= 80:
      print("A")
   elif S >= 65 and S < 80:
      print("B")
   elif S >= 50 and S < 65:
      print("C")
   elif S >= 30 and S < 50:
      if r >= 50:
         print("C")
      else:
         print("D")
   else:
      print("F")


Fixed submission:
while True:
   m, f, r = map(int, input().split())
   if m == -1 and f == -1 and r == -1:
      break
   S = m + f
   if m == -1 or f == -1:
      print("F")
   elif S >= 80:
      print("A")
   elif S >= 65 and S < 80:
      print("B")
   elif S >= 50 and S < 65:
      print("C")
   elif S >= 30 and S < 50:
      if r >= 50:
         print("C")
      else:
         print("D")
   else:
      print("F")
Buggy python submission (verdict: Runtime Error):
# -*-coding:utf-8
#????????????????????§??¨???

def main():

    line = input()
    print(line[::-1])

if __name__ == '__main__':
    main()

Fixed submission:
# -*-coding:utf-8
#????????????????????§??¨???

def main():

    line = input()
    print(line[::-1])

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    print(IsPrime(N))

def IsPrime(N):
    count = 0
    for i in range(N):
        inputNum = int(input())
        if(inputNum == 2):
            count += 1
            continue
        elif(inputNum % 2 == 0):
            continue

        flag = 0
        for j in range(3, int(inputNum/2), 2):
            if(inputNum % j == 0):
                flag = 1
                break
            else:
                continue
        if(flag == 0):
            count += 1
    
    return count

if __name__ == '__main__':
    main()

Fixed submission:
def main():
    N = int(input())
    print(IsPrime(N))

def IsPrime(N):
    count = 0
    for i in range(N):
        inputNum = int(input())
        if(inputNum == 2):
            count += 1
            continue
        elif(inputNum % 2 == 0):
            continue

        flag = 0
        for j in range(3, int(pow(inputNum, 1/2))+1):
            if(inputNum % j == 0):
                flag = 1
                break
            else:
                continue
        if(flag == 0):
            count += 1
    
    return count

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
# -*-coding:utf-8

import math

def main():

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

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

if __name__ == '__main__':
    main()

Fixed submission:
# -*-coding:utf-8

import math

def main():

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

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

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
n = int(input())

print('{0}'.format(pow(n, 3))

Fixed submission:
n = int(input())

print('{0}'.format(pow(n, 3)))
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())

print('{0} {1}'.format(a*b, 2a+2b))

Fixed submission:
import fileinput

for line in fileinput.input():
  a, b = map(int, line.strip().split())

print('{0} {1}'.format(a*b, (2*a)+(2*b)))

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

for line in sys.stdin.readlines():
  a, b = map(int, line.split())

print('{0} {1}'.format(a*b, 2a+2b))

Fixed submission:
import fileinput

for line in fileinput.input():
  a, b = map(int, line.strip().split())

print('{0} {1}'.format(a*b, (2*a)+(2*b)))

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

for line in sys.stdin.readlines():
  a, b = map(int, line.split())

print('{0} {1}'.format(a*b, 2a+2b))

Fixed submission:
import fileinput

for line in fileinput.input():
  a, b = map(int, line.strip().split())

print('{0} {1}'.format(a*b, (2*a)+(2*b)))

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

for line in fileinput.input():
  a, b = map(int, line.strip().split())

print('{0} {1}'.format(a*b, 2a+2b))

Fixed submission:
import fileinput

for line in fileinput.input():
  a, b = map(int, line.strip().split())

print('{0} {1}'.format(a*b, (2*a)+(2*b)))
Buggy python submission (verdict: Runtime Error):
# -*-coding:utf-8

import fileinput
import math

def main():

    for line in fileinput.input():
        a, b, c = map(int, line.strip().split())

        if(a < b && b <c):
            print('Yes')
        else:
            print('No')

if __name__ == '__main__':
    main()

Fixed submission:
# -*-coding:utf-8

import fileinput
import math

def main():

    for line in fileinput.input():
        a, b, c = map(int, line.strip().split())

        if(a < b and b <c):
            print('Yes')
        else:
            print('No')

if __name__ == '__main__':
    main()

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

import fileinput
import math

def main():

    for line in fileinput.input():
        a, b, c = map(int, line.strip().split())

        if(a < b && b <c):
            print('Yes')
        else:
            print('No')

if __name__ == '__main__':
    main()

Fixed submission:
# -*-coding:utf-8

import fileinput
import math

def main():

    for line in fileinput.input():
        a, b, c = map(int, line.strip().split())

        if(a < b and b <c):
            print('Yes')
        else:
            print('No')

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
# -*-coding:utf-8

import fileinput
import math

def main():

    a = int(input())
    PI = math.pi
    area =  a * a * PI
    circum = 2 * a * PI

    print('%lf %lf' % (area, circum))


if __name__ == '__main__':
    main()

Fixed submission:
# -*-coding:utf-8

import fileinput
import math

def main():

    a = float(input())
    PI = math.pi
    area =  a * a * PI
    circum = 2 * a * PI

    print('%lf %lf' % (area, circum))


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
# -*-coding:utf-8

def main():

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

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

        print(count)

if __name__ == '__main__':
    main()

Fixed submission:
# -*-coding:utf-8

def main():

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

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

        print(count)

if __name__ == '__main__':
    main()

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

def main():

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

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

        print(count)

if __name__ == '__main__':
    main()

Fixed submission:
# -*-coding:utf-8

def main():

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

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

        print(count)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
# -*-coding:utf-8

import numpy as np

def main():

    while True:
        inputLine = list(input())
        if(inputLine[0] == '-'):
            break

        deck = np.array(inputLine)

        shuffleTime = int(input())

        for i in range(shuffleTime):
            rollNumber = int(input())
            deck = np.roll(deck, -rollNumber)

        print(''.join(deck))


if __name__ == '__main__':
    main()

Fixed submission:
# -*-coding:utf-8

def main():

    while True:
        deck = input()
        if(deck == '-'):
            break

        shuffleTime = int(input())

        for i in range(shuffleTime):
            rollNumber = int(input())
            deck = deck[rollNumber:] + deck[:rollNumber]

        print(''.join(deck))


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
# coding:utf-8

syako = []
number = input()
while True:
    if number != 0:
        syako.append(number)
    elif number == 0:
        print syako.pop()
    number = input()
    if number == EOFError:
        break

Fixed submission:
# coding:utf-8

syako = []
try:
    while True:
        number = int(raw_input())
        if number != 0:
            syako.append(number)
        elif number == 0:
            print syako.pop()
except:
    pass
Buggy python submission (verdict: Runtime Error):
n=input()

for i in range(0,n):
    zahyou=map(float,raw_input().split(" "))
    a=(zahyou[3]-zahyou[1])/(zahyou[2]-zahyou[0])
    b=(zahyou[7]-zahyou[5])/(zahyou[6]-zahyou[4])
    if a==b or a==-b:
        print "YES"
    else:
        print "NO",

Fixed submission:
n = int(raw_input())
for i in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, raw_input().split())
    print "YES" if abs(((y2-y1)*(x4-x3) - (x2-x1)*(y4-y3))) < 1e-10 else "NO"

Buggy python submission (verdict: Runtime Error):
n=int(raw_input())
for i in range(0,n):
        zahyou=map(float,raw_input().split(" "))
        a=(zahyou[3]-zahyou[1])/(zahyou[2]-zahyou[0])
        b=(zahyou[7]-zahyou[5])/(zahyou[6]-zahyou[4])
        if a==b or a==-b:
            print "YES"
        else:
            print "NO",

Fixed submission:
n = int(raw_input())
for i in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, raw_input().split())
    print "YES" if abs(((y2-y1)*(x4-x3) - (x2-x1)*(y4-y3))) < 1e-10 else "NO"

Buggy python submission (verdict: Runtime Error):
# -*- coding:utf-8 -*-
n=int(raw_input())
    for i in range(0,n):
        a,b,c,d,e,f,g,h=map(float,raw_input().split(" "))
        t=(d-b)/(c-a)
        y=(h-f)/(g-e)
        if y==t or y==-t:
            print "YES"
        else:
            print "NO",

Fixed submission:
n = int(raw_input())
for i in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, raw_input().split())
    print "YES" if abs(((y2-y1)*(x4-x3) - (x2-x1)*(y4-y3))) < 1e-10 else "NO"

Buggy python submission (verdict: Runtime Error):
# -*- coding:utf-8 -*-
n=int(raw_input())
for i in range(0,n):
    a,b,c,d,e,f,g,h=map(float,raw_input().split(" "))
    t=(d-b)/(c-a)
    y=(h-f)/(g-e)
    if y==t or y==-t:
        print "YES"
    else:
        print "NO",

Fixed submission:
n = int(raw_input())
for i in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, raw_input().split())
    print "YES" if abs(((y2-y1)*(x4-x3) - (x2-x1)*(y4-y3))) < 1e-10 else "NO"

Buggy python submission (verdict: Runtime Error):
# -*- coding:utf-8 -*-
n=int(raw_input())
for i in range(n):
    a,b,c,d,e,f,g,h=map(float,raw_input().split(" "))
    t=(d-b)/(c-a)
    y=(h-f)/(g-e)
    if y==t or y==-t:
        print "YES"
    else:
        print "NO",

Fixed submission:
n = int(raw_input())
for i in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, raw_input().split())
    print "YES" if abs(((y2-y1)*(x4-x3) - (x2-x1)*(y4-y3))) < 1e-10 else "NO"

Buggy python submission (verdict: Runtime Error):
# -*- coding:utf-8 -*-
n=int(raw_input())
for i in range(n):
    a,b,c,d,e,f,g,h=map(float,raw_input().split())
    t=(d-b)/(c-a)
    y=(h-f)/(g-e)
    if y==t or y==-t:
        print "YES"
    else:
        print "NO",

Fixed submission:
n = int(raw_input())
for i in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, raw_input().split())
    print "YES" if abs(((y2-y1)*(x4-x3) - (x2-x1)*(y4-y3))) < 1e-10 else "NO"
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split(' '))
w_s = [int(input()) for i in range(n)]

max_w = max(w_s)

while True:
    tmp_total_w = 0
    tmp_k = 1
    for w in w_s:
        tmp_total_w += w
        if tmp_total_w > max_w:
            tmp_k += 1
            tmp_total_w = w

    if tmp_k <= k:
        break

    max_w += 1

print(max_w)


Fixed submission:
def calc_k_constP(P):
    tmp_total_w = 0
    tmp_k = 1
    for w in w_s:
        tmp_total_w += w
        if tmp_total_w > P:
            tmp_k += 1
            tmp_total_w = w

    return tmp_k

n, k = map(int, input().split(' '))
w_s = [int(input()) for i in range(n)]

max_w = max(w_s)

left, right = max_w, 10000 * n
while left < right:
    mid = (right + left) // 2
    tmp_k = calc_k_constP(mid)
    if tmp_k <= k:
        right = mid
    else:
        left = mid + 1

print(left)
Buggy python submission (verdict: Time Limit Exceeded):

# 分割した配列をソート
def merge(input: list, m: int)-> list:
    i, j = 0, m
    input_len = len(input)
    tmp_nums = []

    for k in range(0, input_len):
        if j > input_len - 1:
            tmp_nums.insert(k, input[i])
            i += 1
        elif i > m - 1:
            tmp_nums.insert(k, input[j])
            j += 1
        elif input[i] < input[j]:
            tmp_nums.insert(k, input[i])
            i += 1
        else:
            tmp_nums.insert(k, input[j])
            j += 1

    return tmp_nums

# 再帰でマージソート
def merge_sort(input: list)-> list:
    input_len = len(input)
    compare_num = input_len

    if input_len > 1:
        m = int(input_len / 2)
        out = merge_sort(input[:m])
        input[:m] = out[0]
        compare_num += out[1]

        out = merge_sort(input[m:])
        input[m:] = out[0]
        compare_num += out[1]

        input = merge(input, m)

    return input, compare_num

n = int(input())
input_list = list(map(int, input().split(' ')))

input_list = merge_sort(input_list)

print(*input_list[0])
print(input_list[1] - n)


Fixed submission:
count = 0

def merge(A, left, mid, right):
    n1 = mid - left
    n2 = right - mid
    L, R = A[left: left + n1], A[mid: mid + n2]

    L.append(2000000000)
    R.append(2000000000)

    i, j = 0, 0
    for k in range(left, right):
        global count
        count += 1
        #print("k", k, "l", left, "m", mid, "r", right, "L", L, "R", R)
        if L[i] <= R[j]:
            A[k] = L[i]
            i += 1
        else:
            A[k] = R[j]
            j += 1

def mergeSort(A, left, right):
    #print("l", left, "r", right)
    if left + 1 < right:
        mid = (left + right) // 2
        mergeSort(A, left, mid)
        mergeSort(A, mid, right)
        merge(A, left, mid, right)

n = int(input())
input_list = list(map(int, input().split(' ')))

mergeSort(input_list, 0, n)

print(*input_list)
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
def gcd(a,b):
    i = 1
    temp = 1
    while(i <= b):
        if(a % i == 0 and b % i == 0):
            temp = i
        i = i + 1
    print temp

l = raw_input().split()
if(int(l[0]) > int(l[1])):
    gcd(int(l[0]),int(l[1]))
else:
    gcd(int(l[1]),int(l[0]))


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

l = raw_input().split()
if(int(l[0]) > int(l[1])):
    print gcd(int(l[0]),int(l[1]))
else:
    print gcd(int(l[1]),int(l[0]))

Buggy python submission (verdict: Time Limit Exceeded):
def gcd(a,b):
    i = 2
    temp = 1
    while(i <= b):
        while(a % i == 0 and b % i == 0):
            temp = temp * i
            a = a / i
            b = b / i
        i = i + 1
    print temp

l = raw_input().split()
if(int(l[0]) > int(l[1])):
    gcd(int(l[0]),int(l[1]))
else:
    gcd(int(l[1]),int(l[0]))


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

l = raw_input().split()
if(int(l[0]) > int(l[1])):
    print gcd(int(l[0]),int(l[1]))
else:
    print gcd(int(l[1]),int(l[0]))

Buggy python submission (verdict: Time Limit Exceeded):
def gcd(a,b):
    i = 2
    temp = 1
    while(i <= b):
        while(a % i == 0 and b % i == 0):
            temp = temp * i
            a = a / i
            b = b / i
        if(i % 2 == 0):
            i = i + 1
        else:
            i = i + 2
    print temp

l = raw_input().split()
if(int(l[0]) > int(l[1])):
    gcd(int(l[0]),int(l[1]))
else:
    gcd(int(l[1]),int(l[0]))


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

l = raw_input().split()
if(int(l[0]) > int(l[1])):
    print gcd(int(l[0]),int(l[1]))
else:
    print gcd(int(l[1]),int(l[0]))