Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import math
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))
mod = 10**9 + 7 
sys.setrecursionlimit(1000010)

N,M = nm()
digits = [-1] * N
# print(N,M)
for i in range(M):
    s,c = nm()
    # print(s,c)
    ii = s -1 
    # print("A",ii,c)
    if digits[ii] == -1:
        digits[ii] = c
    elif digits[ii] != c:
        print(-1)
        exit(0)

# print(digits)
if N == 1:
    if digits[0] == -1:
        print(0)
    else:
        print(digits[0])
    exit(0)

if digits[0] == -1:
    digits[0] = 1
elif digits[0] == 0:
    print(-1)
    exit(0)

for i in range(1,M):
    if digits[i] == -1:
        digits[i] = 0

xx = "".join(list(map(str,digits)))
print(xx)


Fixed submission:
def solve(n, m):
    ans = [-1] * n
    for _ in range(m):
        s, c = input().split()
        s = int(s) - 1
        if ans[s] == c:
            continue
        elif ans[s] == -1:
            ans[s] = c
        else:
            return -1

    if ans[0] == '0':
        if n == 1:
            return '0'
        else:
            return -1
    elif ans[0] == -1:
        if n == 1:
            return '0'
        else:
            ans[0] = '1'
    for i in range(1, n):
        if ans[i] == -1:
            ans[i] = '0'
    return ''.join(ans)


n, m = list(map(int, input().split()))
print(solve(n, m))

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

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))
mod = 10**9 + 7 
sys.setrecursionlimit(1000010)

N,M = nm()
digits = [-1] * N
# print(N,M)
for i in range(M):
    s,c = nm()
    # print(s,c)
    ii = s -1 
    # print("A",ii,c)
    if digits[ii] == -1:
        digits[ii] = c
    elif digits[ii] != c:
        print(-1)
        exit(0)

# print(digits)
if N == 1:
    if digits[0] == -1:
        print(0)
    else:
        print(digits[0])
    exit(0)

if digits[0] == -1:
    digits[0] = 1
elif digits[0] == 0:
    print(-1)
    exit(-1)

for i in range(1,M):
    if digits[i] == -1:
        digits[i] = 0

xx = "".join(list(map(str,digits)))
print(xx)



Fixed submission:
def solve(n, m):
    ans = [-1] * n
    for _ in range(m):
        s, c = input().split()
        s = int(s) - 1
        if ans[s] == c:
            continue
        elif ans[s] == -1:
            ans[s] = c
        else:
            return -1

    if ans[0] == '0':
        if n == 1:
            return '0'
        else:
            return -1
    elif ans[0] == -1:
        if n == 1:
            return '0'
        else:
            ans[0] = '1'
    for i in range(1, n):
        if ans[i] == -1:
            ans[i] = '0'
    return ''.join(ans)


n, m = list(map(int, input().split()))
print(solve(n, m))
Buggy python submission (verdict: Runtime Error):
import math
import sys

m=10**9 + 7 
sys.setrecursionlimit(1000010)
N=int(input())
A  = list(map(int,input().split()))

# print(A)
dictA={}

for i in A:
    if i in dictA: 
        print("NO")
        exit(0)
    dictA[i]=1
print("YES"
)
[myoden@ubuntu002 C]$ cat testC.py  ;echo 
import math
import sys

m=10**9 + 7 
sys.setrecursionlimit(1000010)
N=int(input())
A  = list(map(int,input().split()))

# print(A)
dictA={}

for i in A:
    if i in dictA: 
        print("NO")
        exit(0)
    dictA[i]=1
print("YES")


Fixed submission:
import math
import sys

m=10**9 + 7 
sys.setrecursionlimit(1000010)
N=int(input())
A  = list(map(int,input().split()))

# print(A)
dictA={}

for i in A:
    if i in dictA: 
        print("NO")
        exit(0)
    dictA[i]=1
print("YES")
Buggy python submission (verdict: Runtime Error):
import math
import sys

m=10**9 + 7 
H = int(input())
W = int(input())
N = int(input())
s = max(H,W)
print((N-1) // s + 1 )[myoden@ubuntu002 A]$ cat testA.py ; echo ;echo 
import math
import sys

m=10**9 + 7 
H = int(input())
W = int(input())
N = int(input())
s = max(H,W)
print((N-1) // s + 1 )



Fixed submission:
import math
import sys

H = int(input())
W = int(input())
N = int(input())
s = max(H,W)
print((N-1) // s + 1 )
Buggy python submission (verdict: Time Limit Exceeded):
import math
import sys

m=10**9 + 7 
sys.setrecursionlimit(1000010)
INF=10 ** 10
N = int(input())
XL = sorted([list(map(int,input().split())) for _ in range(N)])
# print(N,XL)

DP = [ INF for _ in range(N+1)]
DP[0] = -INF
for i in range(N):
    #print(DP)
    (x,l) = XL[i]
    # print(x,l)
    for j in range(1,N+1):
        if DP[j-1] > x -l:
            break
        if ( DP[j-1]<= x -l and x + l < DP[j]):
                DP[j] = x + l
#print(DP)
for i in range(2,N+1):
    if DP[i] == INF:
        print(i-1)
        exit(0)
print(N)



Fixed submission:
import math
import sys

m=10**9 + 7 
sys.setrecursionlimit(1000010)
INF=10 ** 10
N = int(input())
XL = [list(map(int,input().split())) for _ in range(N)]
XLs =sorted([ [xl[0]+xl[1],xl[0]-xl[1]] for xl in XL ])
# print(N,XL,XLs)

t = -INF 
n = 0

for xl in XLs:
    if t <= xl[1]:
        t = xl[0]
        n = n + 1
print(n)

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

m=10**9 + 7 
sys.setrecursionlimit(1000010)
INF=10 ** 10
N = int(input())
XL = sorted([list(map(int,input().split())) for _ in range(N)])
# print(N,XL)

DP = [ INF for _ in range(N+1)]
DP[0] = -INF
for i in range(N):
    #print(DP)
    (x,l) = XL[i]
    # print(x,l)
    for j in range(1,N+1):
        if DP[j-1] > x -l:
            continue
        if ( DP[j-1]<= x -l and x + l < DP[j]):
                DP[j] = x + l
#print(DP)
for i in range(2,N+1):
    if DP[i] == INF:
        print(i-1)
        exit(0)
print(N)



Fixed submission:
import math
import sys

m=10**9 + 7 
sys.setrecursionlimit(1000010)
INF=10 ** 10
N = int(input())
XL = [list(map(int,input().split())) for _ in range(N)]
XLs =sorted([ [xl[0]+xl[1],xl[0]-xl[1]] for xl in XL ])
# print(N,XL,XLs)

t = -INF 
n = 0

for xl in XLs:
    if t <= xl[1]:
        t = xl[0]
        n = n + 1
print(n)
Buggy python submission (verdict: Runtime Error):
import math
import sys
from fractions import gcd
m=10**9 + 7 
sys.setrecursionlimit(1000010)
(N, M) = list(map(int,input().split()))
A  = list(map(int,input().split()))
B = [ a//2 for a in A]

def lcmn(B):
    if len(B)<1 :
        return 1
    elif len(B) == 1:
        return B[0]
    
    x = B[0] * B[1] // gcd(B[0],B[1])
    if x > M:
        return -1 

    for i in range(2,len(B)):
        x  = lcmn([x,B[i]])
        if x > M:
        return -1 
    return x
    

#print(N,M,A,B)

# print(lcmn(B))

x = lcmn(B)
if x == -1:
    print(0)
else:
    print((M//x+1)//2)
    

Fixed submission:
import math
import sys
from fractions import gcd
m=10**9 + 7 
sys.setrecursionlimit(1000010)
(N, M) = list(map(int,input().split()))
A  = list(map(int,input().split()))
B = [ a//2 for a in A]

def log2N (x):
    c = 0
    while True:
        if x % 2 != 0:
            return c
        x = x // 2
        c = c + 1


def lcmn(B):
    if len(B)<1 :
        return 1
    elif len(B) == 1:
        return B[0]
    
    x = B[0] * B[1] // gcd(B[0],B[1])
    if x > M:
        return -1 

    for i in range(2,len(B)):
        x  = lcmn([x,B[i]])
        if x > M:
            return -1 
    return x
    

#print(N,M,A,B)

# print(lcmn(B))

p = log2N(B[0])
# print(p)
for i in range(1,len(B)):
    # print(log2N(B[i]))
    if p != log2N(B[i]):
        print(0)
        exit(0)
        
x = lcmn(B)
if x == -1:
    print(0)
else:
    print((M//x+1)//2)
Buggy python submission (verdict: Runtime Error):
import math
import sys

(A,B,X) = map(int,input().split())


if X < A * 1 + B:
    print(0)
    exit(0)
for i in range(1,10): 
    if X < A * 10**i  + B * (i+1) : 
        print ( (X - B * i)  // A )
        exit(0)

print(10**9)

Fixed submission:
import math
import sys

S=input()

if S == "SUN":
    print(7)
elif S == "MON":
    print(6)
elif S == "TUE":
    print(5)
elif S == "WED":
    print(4)
elif S == "THU":
    print(3)
elif S == "FRI":
    print(2)
elif S == "SAT":
    print(1)
Buggy python submission (verdict: Runtime Error):
import math
import sys

UNDEF=-1
sys.setrecursionlimit(1000010)
N = int(input())
# print(N)
V=[[UNDEF,UNDEF,[],[] ] for _ in range(N) ]      # Vertex
E=[[] for _ in range(N-1) ]    # Edge 

for i in range(N-1):
    (xa,xb) = map(int,input().split())
    # print(xa,xb)
    E[i]=[xa,xb]
    V[xb-1][0]=xa
    V[xb-1][1]=i+1
    V[xa-1][2].append(xb)
    V[xa-1][3].append(i+1)


# print("Edge:", E)
# print("Vertex:",V)

def root_v():
    global UNDEF
    global V
    for i in range(len(V)):
        if V[i][0] == UNDEF:
            return i+1
    return UNDEF

# print("Root Node:",root_v())

def max_degree(s):
    if V[s-1][0] != UNDEF: 
        degree=len(V[s-1][2]) + 1 # Node S 's degree for non root
    else:
        degree=len(V[s-1][2])     # Node S 's degree for root 

    for c in V[s-1][2]:
        degree = max ( degree, max_degree(c) ) 
    return degree

# print("Max Degree:", max_degree(root_v()))
print(max_degree(root_v()))

# Initialize 'color list' for edges
color=[UNDEF for _ in range(N-1)]

def put_colors(s):
    # print("put_color",s)
    global color 
    pcolor = color[V[s-1][1]-1]
    ic = 1
    for i in range(len(V[s-1][3])):
        if ic == pcolor:
            ic = ic + 1
        # print("put_color",s,i,V[s-1][3][i], ic )
        color[V[s-1][3][i]-1] = ic 
        put_colors(V[s-1][2][i])
        ic = ic + 1
    
put_colors(root_v())
for i in range(N-1):
    print(color[i])


Fixed submission:
import math
import sys

UNDEF=-1
sys.setrecursionlimit(1000010)
N = int(input())
# print(N)
V=[[UNDEF,UNDEF,[],[] ] for _ in range(N) ]      # Vertex
E=[[] for _ in range(N-1) ]    # Edge 

for i in range(N-1):
    (xa,xb) = map(int,input().split())
    # print(xa,xb)
    E[i]=[xa,xb]
    V[xb-1][0]=xa
    V[xb-1][1]=i+1
    V[xa-1][2].append(xb)
    V[xa-1][3].append(i+1)


# print("Edge:", E)
# print("Vertex:",V)

def root_v():
    global UNDEF
    global V
    for i in range(len(V)):
        if V[i][0] == UNDEF:
            return i+1
    return UNDEF

# print("Root Node:",root_v())

def max_degree(s):
    if V[s-1][0] != UNDEF: 
        degree=len(V[s-1][2]) + 1 # Node S 's degree for non root
    else:
        degree=len(V[s-1][2])     # Node S 's degree for root 

    for c in V[s-1][2]:
        degree = max ( degree, max_degree(c) ) 
    return degree

# print("Max Degree:", max_degree(root_v()))
print(max_degree(root_v()))

# Initialize 'color list' for edges
color=[UNDEF for _ in range(N-1)]

def put_colors(s):
    # print("put_color",s)
    global color 
    pcolor=UNDEF
    if V[s-1][1] != UNDEF:
        pcolor = color[V[s-1][1]-1]
    ic = 1
    for i in range(len(V[s-1][3])):
        if ic == pcolor:
            ic = ic + 1
        # print("put_color",s,i,V[s-1][3][i], ic )
        color[V[s-1][3][i]-1] = ic 
        put_colors(V[s-1][2][i])
        ic = ic + 1
    
put_colors(root_v())
for i in range(N-1):
    print(color[i])
Buggy python submission (verdict: Time Limit Exceeded):
import math
import sys
import bisect
import array

m=10**9 + 7 
sys.setrecursionlimit(1000010)
(N,K) = map(int,input().split())
A = list( map(int,input().split())) 
# print(N,K,A)
B = list( map(lambda x: x % K, A))
C = [0]
x = 0
i = 0 
for b in B:
    x = (x + b ) % K 
    C.append((x-i-1) % K) 
    i += 1 
    
# print(B,C)

E=[0 for _ in range(K)] 


ans=0
for i in range(N+1):
    ans += E[C[i]]
    if i >= K-1:
        E[C[i-K+1]] -= 1
    # print(i,C[i],ans,E)
    E[C[i]]+=1
print(ans)
exit(0)

Fixed submission:
import math
import sys
import bisect
import array

m=10**9 + 7 
sys.setrecursionlimit(1000010)
(N,K) = map(int,input().split())
A = list( map(int,input().split())) 
# print(N,K,A)
B = list( map(lambda x: x % K, A))
C = [0]
x = 0
i = 0 
for b in B:
    x = (x + b ) % K 
    C.append((x-i-1) % K) 
    i += 1 
    
# print(B,C)

E={}


ans=0
for i in range(N+1):
    if C[i] in E:
        ans += E[C[i]]
        E[C[i]] = E[C[i]] + 1
    else:
        E[C[i]] = 1
    if i >= K-1:
        E[C[i-K+1]] = E[C[i-K+1]] - 1
        if E[C[i-K+1]] == 0:
             E.pop(C[i-K+1])

print(ans)
exit(0)

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

m=10**9 + 7 
sys.setrecursionlimit(1000010)
(N,K) = map(int,input().split())
A = list( map(int,input().split())) 
# print(N,K,A)
B = list( map(lambda x: x % K, A))
C = [0]
x = 0
for b in B:
    x = (x + b ) % K 
    C.append(x)
    
# print(B,C)

ans=0
for i in range(N):
    for j in range(i,N):
        # print(i,j)
        # print(A[i:j+1],C[i],C[j+1],(C[j+1]-C[i]) % K)
        if (C[j+1]-C[i]) % K == j-i+1:
            ans = ans + 1 
print(ans)

exit(0)

Fixed submission:
import math
import sys
import bisect
import array

m=10**9 + 7 
sys.setrecursionlimit(1000010)
(N,K) = map(int,input().split())
A = list( map(int,input().split())) 
# print(N,K,A)
B = list( map(lambda x: x % K, A))
C = [0]
x = 0
i = 0 
for b in B:
    x = (x + b ) % K 
    C.append((x-i-1) % K) 
    i += 1 
    
# print(B,C)

E={}


ans=0
for i in range(N+1):
    if C[i] in E:
        ans += E[C[i]]
        E[C[i]] = E[C[i]] + 1
    else:
        E[C[i]] = 1
    if i >= K-1:
        E[C[i-K+1]] = E[C[i-K+1]] - 1
        if E[C[i-K+1]] == 0:
             E.pop(C[i-K+1])

print(ans)
exit(0)
Buggy python submission (verdict: Runtime Error):
print(x,y)
point=0
if x == 1: 
    point = point + 300000
elif x == 2:
    point = point + 200000
elif x == 3:
    point = point + 100000
if y == 1: 
    point = point + 300000
    if x == 1:
        point = point + 400000
elif y == 2:
    point = point + 200000
elif y == 3:
    point = point + 100000
print(point)
    


Fixed submission:
(x,y) = map(int,input().split())
point=0
if x == 1: 
    point = point + 300000
elif x == 2:
    point = point + 200000
elif x == 3:
    point = point + 100000
if y == 1: 
    point = point + 300000
    if x == 1:
        point = point + 400000
elif y == 2:
    point = point + 200000
elif y == 3:
    point = point + 100000
print(point)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import numpy as np
n,k = list(map(int,input().split()))
s = 0 

for i in range(n):
    h = int(input())
    if h >= k:
        s += 1
print(s)
exit(0)


Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np 
n,k = list(map(int,input().split()))
h = list(map(int,input().split()))

s = 0 
for hi in h:
    if hi >= k:
        s += 1
print(s)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import numpy as np
n,k = list(map(int,input().split()))
s = 0 

for i in range(n):
    h = int(input())
    if h >= k:
        s += 1
print(s)
exit(0)


Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np 
n,k = list(map(int,input().split()))
h = list(map(int,input().split()))

s = 0 
for hi in h:
    if hi >= k:
        s += 1
print(s)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import numpy as np 
import math

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])


    return arr

a,b = list(map(int,input().split()))
gcd = math.gcd(a,b)
# print(gcd)
# print(factorization(gcd))
print(len(factorization(gcd))+1)

Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np 
import math

#a,bの最大公約数
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])


    return arr

a,b = list(map(int,input().split()))
x = gcd(a,b)
# print(gcd)
# print(factorization(gcd))
print(len(factorization(x))+1)
Buggy python submission (verdict: Time Limit Exceeded):
def calc( s , k , n):

	bruh = {}
	for i  in range(1, n + 1): # length
		for j in range( n - ( i - 1)): # start 
			bruh[s[j: j + i:]] = 0
	another = bruh.keys()
	another = sorted(another)
	print( another[k - 1])

s = input()

k = int(input())

n = len(s)
 
calc( s , k , n)

Fixed submission:
def calc( s , k , n):

	bruh = {}
	for i  in range(1, k + 1): # length
		for j in range( n - ( i - 1)): # start 
			bruh[s[j: j + i:]] = 0
	another = bruh.keys()
	another = sorted(another)
	print( another[k - 1])

s = input()

k = int(input())

n = len(s)
 
calc( s , k , n)

Buggy python submission (verdict: Runtime Error):
def calc( s , k , n):

	bruh = {}
	for i  in range(1, n + 1): # length
		for j in range( n - ( i - 1)): # start 
			bruh[s[j: j + i:]] = 0
	another = bruh.keys()
	another = sorted(another)
	print( another[k - 1])

s = raw_input()

k = int(raw_input())

n = len(s)
 
calc( s , k , n)

Fixed submission:
def calc( s , k , n):

	bruh = {}
	for i  in range(1, k + 1): # length
		for j in range( n - ( i - 1)): # start 
			bruh[s[j: j + i:]] = 0
	another = bruh.keys()
	another = sorted(another)
	print( another[k - 1])

s = input()

k = int(input())

n = len(s)
 
calc( s , k , n)

Buggy python submission (verdict: Runtime Error):
def calc( s , k , n):

	bruh = {}
	for i  in range(1, n + 1): # length
		for j in range( n - ( i - 1)): # start 
			bruh[s[j: j + i:]] = 0
	another = bruh.keys()
	another = sorted(another)
	return another[k - 1]

s = raw_input()

k = int(raw_input())

n = len(s)
 
print( calc( s , k , n))

Fixed submission:
def calc( s , k , n):

	bruh = {}
	for i  in range(1, k + 1): # length
		for j in range( n - ( i - 1)): # start 
			bruh[s[j: j + i:]] = 0
	another = bruh.keys()
	another = sorted(another)
	print( another[k - 1])

s = input()

k = int(input())

n = len(s)
 
calc( s , k , n)

Buggy python submission (verdict: Runtime Error):
s = raw_input()

k = int(raw_input())

n = len(s)
bruh = {}
for i  in range(1, n + 1): # length
	for j in range( n - ( i - 1)): # start 
		bruh[s[j: j + i:]] = 0
another = bruh.keys()
another = sorted(another)
print(another[k - 1])

Fixed submission:
def calc( s , k , n):

	bruh = {}
	for i  in range(1, k + 1): # length
		for j in range( n - ( i - 1)): # start 
			bruh[s[j: j + i:]] = 0
	another = bruh.keys()
	another = sorted(another)
	print( another[k - 1])

s = input()

k = int(input())

n = len(s)
 
calc( s , k , n)
Buggy python submission (verdict: Runtime Error):
def func():
	n = input("")
	bruh = []
	for i in range(n):
		var = input("")
		bruh.append(var)
	bruh = list(dict.fromkeys(bruh))
	return len(bruh)
print(func())

Fixed submission:

def func():
	n = int(input(""))
	bruh = []
	for i in range(n):
		var = input("")
		bruh.append(var)
	bruh = list(dict.fromkeys(bruh))
	return len(bruh)
print(func())

Buggy python submission (verdict: Runtime Error):
n = input("")
bruh = []
for i in range(n):
	var = input("")
	bruh.append(var)
bruh = list(dict.fromkeys(bruh))
print(len(bruh))

	

Fixed submission:

def func():
	n = int(input(""))
	bruh = []
	for i in range(n):
		var = input("")
		bruh.append(var)
	bruh = list(dict.fromkeys(bruh))
	return len(bruh)
print(func())
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split()))
memo = [-1 for i in range(n)]

def dp(i):
    if i == 0:
        return 0
    elif i >= 2:
        if memo[i] != -1:
            return memo[i]
        else:
            memo[i] = min(dp(i-2) + abs(h[i]-h[i-2]), dp(i-1) + abs(h[i]-h[i-1]))
            return memo[i]
    else:
        return abs(h[1]-h[0])

print(dp(n-1))

Fixed submission:
import sys
sys.setrecursionlimit(1000000)

n = int(input())
h = list(map(int,input().split()))
memo = [-1 for i in range(n)]

def dp(i):
    if i == 0:
        return 0
    elif i >= 2:
        if memo[i] != -1:
            return memo[i]
        else:
            memo[i] = min(dp(i-2) + abs(h[i]-h[i-2]), dp(i-1) + abs(h[i]-h[i-1]))
            return memo[i]
    else:
        return abs(h[1]-h[0])

print(dp(n-1))
Buggy python submission (verdict: Runtime Error):
import math

n, m = [int(i) for i in input().split()]
s = input()
t = input()

ans = n * m // math.gcd(n, m)

for scnt in range(n):
    if scnt * m % n == 0:
        tcnt = scnt * m // n
        if s[scnt] != t[tcnt]:
            ans = -1
            break

print(ans)

Fixed submission:
import math
import fractions

n, m = [int(i) for i in input().split()]
s = input()
t = input()

ans = n * m // fractions.gcd(n, m)

for scnt in range(n):
    if scnt * m % n == 0:
        tcnt = scnt * m // n
        if s[scnt] != t[tcnt]:
            ans = -1
            break

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())

g = m // n
while 1:
    if m % g == 0:
        break
    g -= 1

print(g)

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

g = m // n
while 1:
    if m % g == 0:
        break
    g -= 1

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

(d, g) = map(int, input().split(" "))

p = []
c = []

for i in range(d):
    (_p, _c) = map(int, input().split(" "))
    p.append(_p)
    c.append(_c)

ans = 114514
for order in itertools.permutations(range(d)):
    point = 0
    cnt = 0
    for i in order:
        if g - point <= 100 * (i + 1) * p[i]:
            cnt += math.ceil((g - point) / (100 * (i + 1)))
            break
        elif g - point <= 100 * (i + 1) * p[i] + c[i]:
            cnt += p[i]
            break
        else:
            point += 100 * (i + 1) * p[i] + c[i]
            cnt += p[i]         

    ans = min([ans, cnt])

print(ans)

Fixed submission:
import math
import itertools

(d, g) = map(int, input().split(" "))

p = []
c = []

for i in range(d):
    (_p, _c) = map(int, input().split(" "))
    p.append(_p)
    c.append(_c)

ans = 114514
for order in itertools.permutations(range(d)):
    point = 0
    cnt = 0
    for i in order:
        if g - point <= 100 * (i + 1) * p[i]:
            cnt += math.ceil((g - point) / (100 * (i + 1)))
            break
        elif g - point <= 100 * (i + 1) * p[i] + c[i]:
            cnt += p[i]
            break
        else:
            point += 100 * (i + 1) * p[i] + c[i]
            cnt += p[i]         

    ans = min([ans, cnt])

print(ans)
Buggy python submission (verdict: Runtime Error):
A, B = input().split()
A = int(A)
# B = int(B.replace(".", ""))
# B = (int(B[0]) - 0) * 100 + (int(B[2]) - 0) * 10 + (int(B[3]) - 0)
print(A * B // 100)

Fixed submission:
A, B = input().split()
A = int(A)
# B = int(B.replace(".", ""))
B = (int(B[0]) - 0) * 100 + (int(B[2]) - 0) * 10 + (int(B[3]) - 0)
print(A * B // 100)

Buggy python submission (verdict: Runtime Error):
A, B = input().split()
A = int(A)
B = int(B.replace(".", ""))
print(int(str(int(A * B))[:-2]))

Fixed submission:
A, B = input().split()
A = int(A)
# B = int(B.replace(".", ""))
B = (int(B[0]) - 0) * 100 + (int(B[2]) - 0) * 10 + (int(B[3]) - 0)
print(A * B // 100)

Buggy python submission (verdict: Runtime Error):
A, B = input().split()
A = int(A)
B = B.replace(".", "")
print(int(A * B / 100))

Fixed submission:
A, B = input().split()
A = int(A)
# B = int(B.replace(".", ""))
B = (int(B[0]) - 0) * 100 + (int(B[2]) - 0) * 10 + (int(B[3]) - 0)
print(A * B // 100)