Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
ll = []

for i in range(n):
    l = list(map(int, input().split()))
    ll.append(l)

i = 0
while i < n-1:
    k = i+1
    while k <= n-1:
        if ll[i][0] > ll[k][0]:
            ll[i], ll[k] = ll[k], ll[i]
        k += 1
    i+=1
s = 0
cst = 0
while m > 0:
    cst += ll[s][0] * ll[s][1]
    m -= ll[s][1]
    s += 1
print(cst + m*ll[s-1][0])

Fixed submission:
n, m = map(int, input().split())
ll = []
for i in range(n):
    l = list(map(int, input().split()))
    ll.append(l)

ll.sort()

t = 0
cst = 0
i = 0
while t < m:
    t += ll[i][1]
    cst += ll[i][0]*ll[i][1]
    if t > m:
        cst -= ll[i][0]*(t-m)
    i += 1
print(cst)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
ll = [[] for _ in range(n) ]

for i in range(n):
    a, b = map(int, input().split())
    ll[i].append(a)
    ll[i].append(b)
i = 0
while i < n-1:
    k = i+1
    while k <= n-1:
        if ll[i][0] > ll[k][0]:
            ll[i], ll[k] = ll[k], ll[i]
        k += 1
    i+=1
s = 0
cst = 0
while m > 0:
    cst += ll[s][0] * ll[s][1]
    m -= ll[s][1]
    s += 1
print(cst + m*ll[s-1][0])

Fixed submission:
n, m = map(int, input().split())
ll = []
for i in range(n):
    l = list(map(int, input().split()))
    ll.append(l)

ll.sort()

t = 0
cst = 0
i = 0
while t < m:
    t += ll[i][1]
    cst += ll[i][0]*ll[i][1]
    if t > m:
        cst -= ll[i][0]*(t-m)
    i += 1
print(cst)
Buggy python submission (verdict: Runtime Error):
n = int(input())
t, a = map(int, input().split())
hl = list(map(int, input().split()))
count = 1
ss = 1000000000
ans = 0
for h in hl:
    if t-h*0.006-a >= 0:
        if float(t-h*0.006-a) < ss:
            ans = count
            count+=1
        else:
            count+=1
    else:
        if float(-t+h*0.006+a) > -ss:
            ans = count
            count+=1
            count+=1
        else:

print(ans)


Fixed submission:
n = int(input())
t, a = map(int, input().split())
hl = list(map(int, input().split()))
ll = [t-h*0.006-a for h in hl]
ans = 1
dd = 1000000000
for i in range(n):
    if ll[i] >= 0 and ll[i] < dd:
        ans = i+1
        dd = ll[i]
    elif ll[i] < 0 and -ll[i] < dd:
        ans = i+1
        dd = -ll[i]
    else:
        pass

print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()
k = int(input())

if k == 1:
    print(int(s[0]))
elif s[0] == "1":
    cnt = 0
    while  s[cnt] == "1":
        cnt += 1
    if cnt >= k:
        print(1)
    else:
        print(s[cnt])
else:
    print(int(s[0]))

Fixed submission:
s = input()
k = int(input())

if k == 1:
    print(int(s[0]))
elif s[0] == "1":
    cnt = 0
    while  cnt < len(s) and s[cnt] == "1" :
        cnt += 1
    if cnt >= k:
        print(1)
    elif cnt == len(s):
        print("1")
    else:
        print(s[cnt])
else:
    print(int(s[0]))
Buggy python submission (verdict: Time Limit Exceeded):
import copy
A,B,C,k = map(float,input().split())
for _ in range(int(k)):
    a = copy.copy(A)
    b = copy.copy(B)
    c = copy.copy(C)
    A = b + c
    B = c + a
    C = a + b
print(int(A-B))


Fixed submission:
A,B,C,k = map(int,input().split())
s1 = A-B
s2 = B-A
if k%2 == 0:
    print(s1)
elif k%2 == 1:
    print(s2)
Buggy python submission (verdict: Runtime Error):
import math
x = int(input())
i = 1

def expo(x,i):
    while x % i == 0:
        x = x//i
    if x == 1:
        return True
    else:
        return False

while x >= 1:
    for j in range(2,int(math.sqrt(x))+1):
        if expo(x, j) == True:
            print(x)
            break
    if expo(x,j) == True:
        break
    else:
        x -= 1


Fixed submission:
import math
x = int(input())
i = 1

def expo(x,i):
    while x % i == 0:
        x = x//i
    if x == 1:
        return True
    else:
        return False

if x > 4:
    while x >1:
        for j in range(2,int(math.sqrt(x))+1):
            if expo(x, j) == True:
                print(x)
                break
        if expo(x,j) == True:
            break
        else:
            x -= 1
else:
    print(1)
Buggy python submission (verdict: Time Limit Exceeded):
ss = int(input())
t = 0
i = 0
while t < ss:
    t += 9*10**i
    i += 1
tmp = 0
def sumup(x):
    res = 0
    for i in str(x):
        res += int(i)
    return res

while ss >= t-9*10**(i-1) :
    s = sumup(ss)
    if tmp < s:
        tmp = s
    else:
        pass
    ss -= 1

print(tmp)


Fixed submission:
s = input()
cnt = len(s)

if s[0] == "9":
    if s[1:] == "9"*(cnt-1):
        print(9*cnt)
    else:
        print(8+9*(cnt-1))
else:
    if s[1:] == "9"*(cnt-1):
        print(int(s[0]) + 9*(cnt-1))
    else:
        print((int(s[0])-1) + 9*(cnt-1))
Buggy python submission (verdict: Runtime Error):
n = int(input())
l0 = 2
l1 = 1
if n == 0:
    print(l0)
elif n == 1:
    print(l1)
elif n>= 2:
    ll = [l0, l1] + [0 for _ in range(n-1)]
    for i in range(2,n+1):
        ll[i] = ll[i-1] + ll[i-2]

print(ll[n])


Fixed submission:
n = int(input())
l0 = 2
l1 = 1
if n == 0:
    print(l0)
elif n == 1:
    print(l1)
elif n>= 2:
    ll = [l0, l1] + [0 for _ in range(n-1)]
    for i in range(2,n+1):
        ll[i] = ll[i-1] + ll[i-2]
    print(ll[n])
Buggy python submission (verdict: Runtime Error):
s = input()
ll = [i for i in range(97,123,1)]
for j in s:
    s_num = ord(j)
    if s_num in ll:
        ll.remove(s_num)
    else:
        pass
print(chr(ll[0]))


Fixed submission:
s = input()
ll = [i for i in range(97,123,1)]
for j in s:
    s_num = ord(j)
    if s_num in ll:
        ll.remove(s_num)
    else:
        pass
if len(ll) != 0:
    print(chr(ll[0]))
else:
    print("None")
Buggy python submission (verdict: Runtime Error):
n = int(input())
al = [0 for _ in range(n)]
for i in range(n):
    al[i] = int(input())

def check(al,bl,i):
    bl.append(i)
    i = al[i]-1
    if len(bl) == len(al):
        print(-1)
    elif i in bl:
        print(-1)
    elif i == 1:
        print(len(bl))
    else:
        check(al,bl,i)

bl = []
check(al,bl,0)

Fixed submission:
n = int(input())
al = [int(input()) for i in range(n)]

i = 0
for j in range(n):
    i = al[i]-1
    if i == 1:
        print(j+1)
        exit()
print(-1)

Buggy python submission (verdict: Runtime Error):
n = int(input())
al = [0 for _ in range(n)]
for i in range(n):
    al[i] = int(input())

def check(al,bl,i):
    bl.append(i)
    i = al[i]-1
    if i in bl:
        print(-1)
    elif i == 1:
        print(len(bl))
    else:
        check(al,bl,i)

bl = []
check(al,bl,0)

Fixed submission:
n = int(input())
al = [int(input()) for i in range(n)]

i = 0
for j in range(n):
    i = al[i]-1
    if i == 1:
        print(j+1)
        exit()
print(-1)

Buggy python submission (verdict: Runtime Error):
n = int(input())
al = [0 for _ in range(n)]
for i in range(n):
    al[i] = int(input())

def check(al,bl,i):
    bl.append(i)
    i = al[i]-1
    if i in bl:
        print("-1")
    elif i == 1:
        print(len(bl))
    else:
        check(al,bl,i)

bl = []
check(al,bl,0)

Fixed submission:
n = int(input())
al = [int(input()) for i in range(n)]

i = 0
for j in range(n):
    i = al[i]-1
    if i == 1:
        print(j+1)
        exit()
print(-1)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
ll = [0] + [ 0 * n]
for i in range(m):
    a, b = map(int, input().split())
    ll[a] += 1
    ll[b] += 1
for l in ll[1:]:
    print()


Fixed submission:
n, m = map(int, input().split())
ll = [[0]] + [ [] for _ in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    ll[a].append(b)
    ll[b].append(a)
for l in ll[1:]:
    print(len(l))
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
al = []
bl = []
for i in range(n):
    a, b = map(int, input().split())
    al.append([a, b])
for j in range(m):
    c, d = map(int, input().split())
    bl.append([c,d])

def check(a,b):
    x = a[0] - b[0]
    y = a[1] - b[1]
    if x < 0:
        x = -x
    if y < 0:
        y = -y
    return x + y

for a in al:
    min = 100000000
    cnt = 1
    for b in bl:
        tmp = check(a,b)
        if tmp < min:
            ans = cnt
            min = tmp
        cnt += 1
    print(ans)

Fixed submission:
n, m = map(int, input().split())
al = []
bl = []
for i in range(n):
    a, b = map(int, input().split())
    al.append([a, b])
for j in range(m):
    c, d = map(int, input().split())
    bl.append([c,d])

def check(a,b):
    x = a[0] - b[0]
    y = a[1] - b[1]
    if x < 0:
        x = -x
    if y < 0:
        y = -y
    return x + y

for a in al:
    min = 1000000000
    cnt = 1
    for b in bl:
        tmp = check(a,b)
        if tmp < min:
            ans = cnt
            min = tmp
        cnt += 1
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
pwr = 1
for i in range(n): 
    pwr *= 1*(i+1)
print(pwr%(10**9+7))

Fixed submission:
n = int(input())
pwr = 1
for i in range(n): 
    pwr *= 1*(i+1)
    pwr = pwr%(10**9+7)
print(pwr)
Buggy python submission (verdict: Time Limit Exceeded):
def findSumOfDigits(n):
    sum = 0
    while (n > 0):
        sum += n % 10
        n //= 10
    return sum

n = int(input())
total = findSumOfDigits(n)
if total % 9 == 0:
    print("Yes")
else:
    print("No")

Fixed submission:
n = int(input())

if n % 9 == 0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
eList = [chr(i) for i in range(97, 97+26)]
N = int(input())

n = N
mod = N
numList = []

while n > 0:
    n, mod = divmod(n, 26)
    if mod != 0:
        # 末尾ではなく先頭に追加する
        # 1のくらいから判定して行っているため
        numList.insert(0, mod - 1)
    else:
        numList.insert(0, 25)
        # 26進数のようで26まで数字があるため調整する
        n -= 1

ans = ''
for num in numList:
    ans += eList[num]
print(ans)

Fixed submission:
a = input()
if str.isupper(a):
    print("A")
else:
    print("a")
Buggy python submission (verdict: Runtime Error):
from itertools import combinations_with_replacement

n,m,q = map(int, input().split())
l = list(list(map(int, input().split())) for i in range(n))
ans = 0

for l2 in combinations_with_replacement(range(1,m+1),n):
    total = 0
    for i in range(q):
        if l2[l[i][1] - 1] - l2[l[i][0] - 1] == l[i][2]:
            total += l[i][3]
    ans = max(ans, total)
print(ans)

Fixed submission:
from itertools import combinations_with_replacement as c
N, M, Q = map(int, input().split())
l1 = list(list(map(int, input().split())) for _ in range(Q))
ans = 0

for l2 in c(range(1, M + 1), N):
    total = 0
    for i in range(Q):
        if l2[l1[i][1] - 1] - l2[l1[i][0] - 1] == l1[i][2]:
            total += l1[i][3]
    ans = max(ans, total)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math

k = int(input())
total = 0
for i in range(1,k+1):
    for j in range(1,k+1):
        for k in range(1,k+1):
            total += math.gcd(math.gcd(i, j),k)
print(total)

Fixed submission:
import math

k = int(input())
total = 0
for i in range(1,k+1):
    for j in range(1,k+1):
        tmp = math.gcd(i, j)
        for k in range(1,k+1):
            total += math.gcd(tmp,k)
print(total)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 0

for i in range(n):
    print(a,b)
    if b[i] >= sum(a[i:i+2]):
        ans += sum(a[i:i+2])
        a[i+1] = 0
    elif a[i] >= b[i]:
        ans += b[i]
    elif a[i] < b[i]:
        ans += b[i]
        a[i+1] -= b[i] - a[i]
print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 0

for i in range(n):
    if b[i] >= sum(a[i:i+2]):
        ans += sum(a[i:i+2])
        a[i+1] = 0
    elif a[i] >= b[i]:
        ans += b[i]
    elif a[i] < b[i]:
        ans += b[i]
        a[i+1] -= b[i] - a[i]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ls = [int(input()) for _ in range(n)]
p = 200000
ans = 0
if p>n:p=n

def cul(n, x):
    l = len(x)
    b = [x[i] for i in range(l)]
    b.pop(n)
    return max(b)
    
for i in range(n):
    s = cul(i,ls)
    print(s)

Fixed submission:
n = int(input())
ls = [int(input()) for _ in range(n)]
ls_sort = sorted(ls,reverse=True)

for i in range(n):
    if ls[i] == ls_sort[0]:
        print(ls_sort[1])
    else:
        print(ls_sort[0])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ls = [int(input()) for _ in range(n)]
p = 200000
ans = 0
if p>n:
    p=n

def cul(n, x):
    l = len(x)
    b = [x[i] for i in range(l)]
    b.pop(n)
    return max(b)
    
for i in range(p):
    s = cul(i,ls[:p])
    print(s)

Fixed submission:
n = int(input())
ls = [int(input()) for _ in range(n)]
ls_sort = sorted(ls,reverse=True)

for i in range(n):
    if ls[i] == ls_sort[0]:
        print(ls_sort[1])
    else:
        print(ls_sort[0])

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations
import copy

n = int(input())
ls = [int(input()) for _ in range(n)]
p = 200000
ans = 0
if p>n:
    p=n

def cul(n, x):
    l = len(x)
    b = [x[i] for i in range(l)]
    b.pop(n)
    return max(b)
    
for i in range(p):
    s = cul(i,ls[:p])
    print(s)

Fixed submission:
n = int(input())
ls = [int(input()) for _ in range(n)]
ls_sort = sorted(ls,reverse=True)

for i in range(n):
    if ls[i] == ls_sort[0]:
        print(ls_sort[1])
    else:
        print(ls_sort[0])

Buggy python submission (verdict: Runtime Error):
from itertools import combinations
import copy

n = int(input())
ls = [int(input()) for _ in range(n)]
p = 50
ans = 0
if n>p:p=n

def cul(n, x):
    l = len(x)
    b = [x[i] for i in range(l)]
    b.pop(n)
    return max(b)
    
for i in range(p):
    s = cul(i,ls[:p])
    print(s)

Fixed submission:
n = int(input())
ls = [int(input()) for _ in range(n)]
ls_sort = sorted(ls,reverse=True)

for i in range(n):
    if ls[i] == ls_sort[0]:
        print(ls_sort[1])
    else:
        print(ls_sort[0])

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations
import copy

n = int(input())
ls = [int(input()) for _ in range(n)]

def function(n,ls):
    array = copy.deepcopy(ls)
    array.pop(n)
    return max(array)
    
for i in range(n):
    print(function(i,ls))

Fixed submission:
n = int(input())
ls = [int(input()) for _ in range(n)]
ls_sort = sorted(ls,reverse=True)

for i in range(n):
    if ls[i] == ls_sort[0]:
        print(ls_sort[1])
    else:
        print(ls_sort[0])
Buggy python submission (verdict: Runtime Error):
n = iint(input())
ls = []
for i in range(1,n+1):
  s,p = input().split()
  ls.append([i,s,int(p)])
ls.sort(key=lambda x:(x[1], x[2]))
for j in range(len(ls)):
  print(ls[j][0])

Fixed submission:
n = int(input())
ls = []
for i in range(1,n+1):
    s,p = input().split()
    ls.append([i,s,int(p)])
ls.sort(key=lambda x:(x[1], -x[2]))
for j in range(len(ls)):
    print(ls[j][0])
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
s = [[int(x) for x in input().split()][1:] for y in range(m)]
p = [int(z) for z in input().split()]
ans = 0

for i in range(2**n):
    b = array([(i>>j)&1 for j in range(n)])
    if [sum(b[array(k) - 1]) % 2 for k in s] == p:
        ans += 1
print(ans)

Fixed submission:
from numpy import *
n,m = map(int, input().split())

s = [[int(j) for j in input().split()][1:] for i in range(m)]
p = [int(i) for i in input().split()]

ans = 0

for i in range(2**n):
    b = array([(i>>j)&1 for j in range(n)])
    if [sum(b[array(k)-1]) % 2 for k in s] == p:
        ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
s = [[int(x) for x in input().split()][1:] for y in range(m)]
p = [int(z) for z in range(m)]
ans = 0

for i in range(2**n):
    b = array([(i>>j)&1 for j in range(n)])
    if [sum(array(k) - 1) % 2 for k in s] == p:
        ans += 1
print(ans)

Fixed submission:
from numpy import *
n,m = map(int, input().split())

s = [[int(j) for j in input().split()][1:] for i in range(m)]
p = [int(i) for i in input().split()]

ans = 0

for i in range(2**n):
    b = array([(i>>j)&1 for j in range(n)])
    if [sum(b[array(k)-1]) % 2 for k in s] == p:
        ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
from numpy import *
n,m = map(int, input().split())

s = [[int(j) for j in input().split()][1:] for i in range(m)]
p = [int(i) for i in input().split()]

ans = 0

for i in range(2**n):
    b = array([(i >> j)&1 for j in range(n)])
    if [sum(b[array(k) - 1] % 2 for k in s)] == p:
        ans += 1
print(ans)

Fixed submission:
from numpy import *
n,m = map(int, input().split())

s = [[int(j) for j in input().split()][1:] for i in range(m)]
p = [int(i) for i in input().split()]

ans = 0

for i in range(2**n):
    b = array([(i>>j)&1 for j in range(n)])
    if [sum(b[array(k)-1]) % 2 for k in s] == p:
        ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np
n,m = map(int, input().split())
ls = []
for i in range(m):
    l,r = map(int, input().split())
    tmp = list(range(l,r+1))
    ls.append(tmp)
binary = [0] * n
ls = [flatten for inner in ls for flatten in inner]
for i in ls:
    binary[i] += 1
print(binary.count(m))    

Fixed submission:
n,m = map(int, input().split())
ans = 0
L = 1
R = n
for i in range(m):
    l,r = map(int, input().split())
    L = max(l,L)
    R = min(r,R)
    
if L <= R:
    print(R-L+1)
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
import numpy as np
n,m = map(int, input().split())
ls = []
for i in range(m):
    l,r = map(int, input().split())
    tmp = list(range(l,r+1))
    ls.append(tmp)
binary = [0] * n

for i in ls:
    for j in i:
        binary[j] += 1
print(binary.count(m))  

Fixed submission:
n,m = map(int, input().split())
ans = 0
L = 1
R = n
for i in range(m):
    l,r = map(int, input().split())
    L = max(l,L)
    R = min(r,R)
    
if L <= R:
    print(R-L+1)
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
import numpy as np
n,m = map(int, input().split())
ls = []
for i in range(m):
    l,r = map(int, input().split())
    tmp = list(range(l,r+1))
    ls.append(tmp)

print(ls)

binary = [0] * n

for i in ls:
    for j in i:
        binary[j] += 1
print(binary.count(m))    

Fixed submission:
n,m = map(int, input().split())
ans = 0
L = 1
R = n
for i in range(m):
    l,r = map(int, input().split())
    L = max(l,L)
    R = min(r,R)
    
if L <= R:
    print(R-L+1)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
import itertools
import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

n = int(input())
ls = list(map(int, input().split()))
ls_com = itertools.combinations(ls, n-1)
ans = 0

for i in ls_com:
    ans = max(gcd_list(i),ans)
print(ans)

Fixed submission:
import fractions

n = int(input())
a = list(map(int, input().split()))

l = [0]
r = [0]
for i in range(n):
    l.append(fractions.gcd(l[i], a[i]))
    r.append(fractions.gcd(r[i], a[-(i+1)]))
    
m = [fractions.gcd(l[i], r[-(i+2)]) for i in range(n)]
print(max(m))
Buggy python submission (verdict: Runtime Error):
n = int(input())
listNum = [int(x) for x in input.split()]
cnt = 1
big = listNum[0]
for i in range(1,n):
	if(big <= listNum[i]):
		big = listNum[i]
		cnt+=1
print(cnt)

Fixed submission:
n = int(input())
listNum = [int(x) for x in input().split()]
cnt = 1
big = listNum[0]
for i in range(1,n):
	if(big <= listNum[i]):
		big = listNum[i]
		cnt+=1
print(cnt)
Buggy python submission (verdict: Runtime Error):
n,q = map(int, input().split())
s = input()

t = [0] * n +1
for i in range(n):
    t[i+1] = t[i] + (1if s[i:i+2] == "AC" else 0)
    
for i in range(q):
    l,r = map(int, input().split())
    print(t[r-1] - t[l-1])

Fixed submission:
n,q = map(int, input().split())
s = input()

t = [0] * (n +1)
for i in range(n):
    t[i+1] = t[i] + (1if s[i:i+2] == "AC" else 0)
    
for i in range(q):
    l,r = map(int, input().split())
    print(t[r-1] - t[l-1])

Buggy python submission (verdict: Runtime Error):
n,q = map(int, input().split())
s = input()
flag = False
cnt = 0
dp = []
for i in range(len(s)):
    if s[i] == "A":
        flag = True
        dp.append(cnt)
        continue
    if s[i] == "C" and flag:
        cnt += 1
        dp.append(cnt)
        flag = False
for i in range(q):
    l,r = map(int, input().split())
    print(max(dp[l:r]) - dp[l-1])

Fixed submission:
n,q = map(int, input().split())
s = input()

t = [0] * (n +1)
for i in range(n):
    t[i+1] = t[i] + (1if s[i:i+2] == "AC" else 0)
    
for i in range(q):
    l,r = map(int, input().split())
    print(t[r-1] - t[l-1])
Buggy python submission (verdict: Runtime Error):
A,B = int(input().split())
if(B % A == 0):
  print(A + B)
else:
  print(B - A)


Fixed submission:
A,B=(int(x) for x in input().split())
if(B % A == 0):
  print(A + B)
else:
  print(B - A)
Buggy python submission (verdict: Runtime Error):
a,b = (int(x) for x in input.split())
 
print(round((a/b),10))

Fixed submission:
a,b = [int(x) for x in input().split()]
 
print(round((a/b),10))

Buggy python submission (verdict: Runtime Error):
a,b = [int(x) for x in input.split()]

print(round((a/b),10))

Fixed submission:
a,b = [int(x) for x in input().split()]
 
print(round((a/b),10))
Buggy python submission (verdict: Runtime Error):
a,b,c = [int(i) for i in input().split()]
print((a * b) / 2))

Fixed submission:
a,b,c = [int(i) for i in input().split()]
print(a * b // 2)
Buggy python submission (verdict: Runtime Error):
import sympy

n, p = map(int, input().split())
ls = sympy.factorint(p)
maxNum = 0
ans = 1

for key, value in ls.items():
    if value >= n:
        ans *= key
print(ans)

Fixed submission:
import sys
n, p = map(int, input().split())

if n == 1:
    print(p)
    sys.exit()
# 素因数分解
ls = {}
for i in range(2, int(p**0.5) + 1):
    while p % i == 0:
        ls[i] = ls.get(i, 0) + 1
        p //= i
if p > 1:
    ls[p] = 1
ans = 1

for key, value in ls.items():
    while value >= n:
        ans *= key
        value -= n
print(ans)
Buggy python submission (verdict: Runtime Error):
D = int(input)
eve = "Eve" * (25 - D)
print("Christmas" + str(eve))

Fixed submission:
D = int(input())
eve = "Eve " * (25 - D)
print("Christmas " + str(eve))

Buggy python submission (verdict: Runtime Error):
D = int(input)
eve = Eve * (25 - D)
print("Christmas" + str(eve))



Fixed submission:
D = int(input())
eve = "Eve " * (25 - D)
print("Christmas " + str(eve))
Buggy python submission (verdict: Runtime Error):
n,k = map(int, input().split())
ls = k[int(input()) for _ in range(n)]
ls.sort()
tmp = 10 ** 9
for i in range(n-k+1):
    diff = ls[i+k-1] - ls[i]
    if diff < tmp:
        tmp = diff
print(diff)

Fixed submission:
n,k = map(int, input().split())
ls = [int(input()) for _ in range(n)]
ls.sort()
tmp = 10 ** 9
for i in range(n-k+1):
    diff = ls[i+k-1] - ls[i]
    if diff < tmp:
        tmp = diff
print(tmp)
Buggy python submission (verdict: Runtime Error):
n = int(input())
def dfs(cur, a, b, c):
    if cur == n:
        return 0
    ret = 1 if all(s.count(c)) > 0 for c in "753") else 0
    for i in "753":
        ret += dfs(s+c)
    return ret
print(dfs("0"))

Fixed submission:
N = int(input())

def dfs(s): 
    if int(s) > N:
        return 0
    ret = 1 if all(s.count(c) > 0 for c in '753') else 0
    for c in '753':
        ret += dfs(s + c)
    return ret

print(dfs('0'))
Buggy python submission (verdict: Runtime Error):
n,m = map(int, input().split())
py = [[list(map(int, input().split()))] + [i] for i in range(m)]
py.sort(key=lambda x: [x[0], x[1]])
ans = []
P = [0] * (n + 1)
for p, y, i in py:
    P[p] += 1
    tmp = str(p).zfill(6) + str(P[p]).zfill(6)
    ans.append([i,tmp])
ans.sort()
for i,a in ans:
    print(a)

Fixed submission:
n,m = map(int, input().split())
py = [list(map(int, input().split())) + [i] for i in range(m)]
py.sort(key=lambda x: [x[0], x[1]])
ans = []
P = [0] * (n + 1)
for p, y, i in py:
    P[p] += 1
    tmp = str(p).zfill(6) + str(P[p]).zfill(6)
    ans.append([i,tmp])
ans.sort()
for i,a in ans:
    print(a)