Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
k,s = map(int,input().split())
ans = 0
for x in range(k+1):
  for y in range(k+1):
    for z in range(k+1):
      if x+y+z==s:
        ans+=1
print(ans)

Fixed submission:
k,s = map(int,input().split())
ans = 0
for x in range(k+1):
  for y in range(0,k+1):
    tmp = s - (x+y)
    if tmp>=0 and tmp<k+1:
      ans+=1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
arr=[int(i) for i in input().split()]
ans=1
for i in arr:
  ans*=i
if ans<=1000000000000000000:
  print(ans)
else:
  print(-1)

Fixed submission:
n=int(input())
arr=[int(i) for i in input().split()]
ans=1
if 0 in arr:
    print(0)
else:
    for i in arr:
        ans=ans*i
        boo=True
        if ans>1000000000000000000:
            print(-1)
            boo=False
            break
    if boo:
        print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
h=[int(i) for i in input().split()]
h.insert(0,0)
ans=[0]*(n+1)
ans[1]=0
ans[2]=abs(h[2]-h[1])
for i in range(3,n+1):
    m=1000000000000000
    boo=False
    for j in range(i-1,i-k-1,-1):
        if j>=1:
            m=min(m,ans[j]+abs(h[i]-h[j]))
            boo=True
        else:
            break
    ans[i]=m
print(ans[n])


Fixed submission:
n,k=map(int,input().split())
h=[int(i) for i in input().split()]
h.insert(0,0)
ans=[0]*(n+1)
ans[1]=0
ans[2]=abs(h[2]-h[1])
for i in range(3,n+1):
    m=1000000000000000
    boo=False
    for j in range(i-1,i-k-1,-1):
        if j>=1:
            m=min(m,ans[j]+abs(h[i]-h[j]))
            boo=True
        else:
            break
    ans[i]=m
print(ans[n])
Buggy python submission (verdict: Time Limit Exceeded):
n,w=map(int,input().split())
value=[]
wt=[]
for i in range(n):
    a,b=map(int,input().split())
    wt.append(a)
    value.append(b)
dp=[[0 for i in range(w+1)] for j in range(n+1)]
for i in range(1,n+1):
    for j in range(1,w+1):
        if wt[i-1]<=j:
            dp[i][j]=max(value[i-1]+dp[i-1][j-wt[i-1]],dp[i-1][j])
        else:
            dp[i][j]=dp[i-1][j]
print(dp[n][w])


Fixed submission:
n,w=map(int,input().split())
value=[]
wt=[]
for i in range(n):
    a,b=map(int,input().split())
    wt.append(a)
    value.append(b)
dp=[[0 for i in range(sum(value)+1)] for j in range(n+1)]
for i in range(sum(value)+1):
    dp[0][i]=1000000000000
for j in range(n+1):
    dp[j][0]=0
for i in range(1,n+1):
    for j in range(1,sum(value)+1):
        if value[i-1]<=j:
            dp[i][j]=min(wt[i-1]+dp[i-1][j-value[i-1]],dp[i-1][j])
        else:
            dp[i][j]=dp[i-1][j]
for i in range(sum(value),-1,-1):
    if dp[-1][i]<=w:
        print(i)
        break
Buggy python submission (verdict: Runtime Error):
def dfs(n,arr,visited):
    for i in graph[n]:
        if visited[i]==False:
            arr[n]=max(arr[n],dfs(i,arr,visited)+1)
            visited[i]=True
        else:
            arr[n]=max(arr[n],arr[i]+1)
    return arr[n]

n,m=map(int,input().split())

graph=[[] for i in range(n)]

for i in range(m):
    a,b=map(int,input().split())
    if a!=b:
        graph[a-1].append(b-1)

visited=[False for i in range(n)]

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

for i in range(n):
    if visited[i]==False:
        dfs(i,arr,visited)
print(max(arr))


Fixed submission:
import sys

sys.setrecursionlimit(10**9)

def dfs(n,arr,visited):
    for i in graph[n]:
        if visited[i]==False:
            arr[n]=max(arr[n],dfs(i,arr,visited)+1)
            visited[i]=True
        else:
            arr[n]=max(arr[n],arr[i]+1)
    return arr[n]

n,m=map(int,input().split())

graph=[[] for i in range(n)]

for i in range(m):
    a,b=map(int,input().split())
    if a!=b:
        graph[a-1].append(b-1)

visited=[False for i in range(n)]

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

for i in range(n):
    if visited[i]==False:
        dfs(i,arr,visited)
print(max(arr))

Buggy python submission (verdict: Runtime Error):
def dfs(n,arr,visited):
    for i in graph[n]:
        if visited[i]==False:
            arr[n]=max(arr[n],dfs(i,arr,visited)+1)
            visited[i]=True
        else:
            arr[n]=max(arr[n],arr[i]+1)
    return arr[n]

n,m=map(int,input().split())

graph=[[] for i in range(n)]

for i in range(m):
    a,b=map(int,input().split())
    graph[a-1].append(b-1)

visited=[False for i in range(n)]

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

for i in range(n):
    if visited[i]==False:
        dfs(i,arr,visited)
print(max(arr))


Fixed submission:
import sys

sys.setrecursionlimit(10**9)

def dfs(n,arr,visited):
    for i in graph[n]:
        if visited[i]==False:
            arr[n]=max(arr[n],dfs(i,arr,visited)+1)
            visited[i]=True
        else:
            arr[n]=max(arr[n],arr[i]+1)
    return arr[n]

n,m=map(int,input().split())

graph=[[] for i in range(n)]

for i in range(m):
    a,b=map(int,input().split())
    if a!=b:
        graph[a-1].append(b-1)

visited=[False for i in range(n)]

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

for i in range(n):
    if visited[i]==False:
        dfs(i,arr,visited)
print(max(arr))
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
arr=[int(i) for i in input().split()]
dp=[[0 for i in range(k+1)] for j in range(n+1)]
for i in range(1,n+1):
    for j in range(1,k+1):
        if arr[i-1]<=j:
            temp=0
            if dp[i][j-arr[i-1]]==0:
                temp=1
            dp[i][j]=temp
            else:
                dp[i][j]=dp[i-1][j]
if dp[n][k]==1:
    print("First")
else:
    print("Second")


Fixed submission:
n,k=map(int,input().split())
arr=[int(i) for i in input().split()]
dp=[0 for i in range(k+1)]
for i in range(1,k+1):
    for j in range(n):
        if arr[j]<=i and dp[i-arr[j]]==0:
            dp[i]=1
if dp[k]==1:
    print("First")
else:
    print("Second")
Buggy python submission (verdict: Time Limit Exceeded):
N =int(input())
L =[]
for i in range(N):
    S = input()
    if not S in L:
        L.append(S)
print(len(L))

Fixed submission:
N =int(input())
S = [input() for i in range(N)]
ans = len(set(S))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))

for i in range(1,N+1):
    print(A.count(i))

Fixed submission:
import collections
N = int(input())
A = list(map(int,input().split()))
c = collections.Counter(A)
for i in range(1,N+1):
    print(c[i])
Buggy python submission (verdict: Time Limit Exceeded):
#162.C
N,K = map(int,input().split())
X = abs(N-K)
while True:
    if abs(X-K)< X:
        X =abs(X-K)
        continue
    else:
        print(X)
        break

Fixed submission:
#162.C
N,K = map(int,input().split())
a = N//K
if abs(K*(a+1)-N)<abs(K*a-N):
    ans = abs(N - (a+1)*K)
else:
    ans = abs(N-a*K)

print(ans)
Buggy python submission (verdict: Runtime Error):
#パナソニックプロ2020
a,b,c=map(int,input().split())
if 4*a*b< (c-a-b)**2:
    print('Yes')
else:
    print('No'

Fixed submission:
#パナソニックプロ2020
a,b,c=map(int,input().split())
if c-a-b<=0:
    print('No')
elif 4*a*b< (c-a-b)**2:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
#パナソニックプロ2020
abc=map(int,input().split())
if a**0.5 +b**0.5 < c**0.5:
    print('Yes')
else:
    print('No')

Fixed submission:
#パナソニックプロ2020
a,b,c=map(int,input().split())
if c-a-b<=0:
    print('No')
elif 4*a*b< (c-a-b)**2:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
#ABC149.B
A,B,K = map(int,input().split())
if K<=A:
    print(A-K)
    print(B)
elif A < K and B-K-A =>0:
    print(0)
    print(B-K-A)
else:
    print(0)
    print(0)

Fixed submission:
#ABC149.B
A,B,K = map(int,input().split())
if K<=A:
    print(A-K)
    print(B)
elif A < K and B-(K-A) >=0:
    print(0)
    print(B-(K-A))
elif A <K and B-K-A<0:
    print(0)
    print(0)
Buggy python submission (verdict: Runtime Error):
#ABC148.C
import math
A,B = map(int,input().split())
def lcm(x,y):
    return x*y//math.gcd(x,y)
print(lcm(A,B))

Fixed submission:
#ABC148.C
import fractions
A,B = map(int,input().split())
def lcm(x,y):
    return x*y//fractions.gcd(x,y)
print(lcm(A,B))

Buggy python submission (verdict: Runtime Error):
#ABC148.C
A,B = map(int,input().split())
import math
def lcm(x,y):
    return x*y//math.gcd(x,y)
print(lcm(A,B))

Fixed submission:
#ABC148.C
import fractions
A,B = map(int,input().split())
def lcm(x,y):
    return x*y//fractions.gcd(x,y)
print(lcm(A,B))
Buggy python submission (verdict: Time Limit Exceeded):
#ABC144.C
N = int(input())
cnt = N+1
for i in range(1,N+1):
    if N % i ==0:
        S = N//i
        cnt = min(cnt,S+i)
print(cnt-2)

Fixed submission:
#ABC144.C
N = int(input())
cnt = N-1
for i in range(2,int(N**0.5)+2):
    if N%i == 0:
        S = N//i + i -2
        if S <= cnt:
            cnt =S
print(cnt)
Buggy python submission (verdict: Runtime Error):
#ABC067.B
N,K = map(int,input().split())
l = [map(int,input().split())]
l.sort()
L = l[(N-K):]
ans = sum(L)
print(ans)

Fixed submission:
#ABC067.B
N,K = map(int,input().split())
l = list(map(int,input().split()))
l.sort()
L = l[(N-K):]
ans = sum(L)
print(ans)

Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
l = [int(input())for i in range(N)]
l.sort()
L = l[(N-K):]
ans = sum(L)
print(ans)

Fixed submission:
#ABC067.B
N,K = map(int,input().split())
l = list(map(int,input().split()))
l.sort()
L = l[(N-K):]
ans = sum(L)
print(ans)
Buggy python submission (verdict: Runtime Error):
#ABC065.B
N = int(input())
a = [int(input()) for i in range(N)]
x = 0
for i in range(N):
    x = a[x]
    if x == 2:
        print(i+1)
        break
else:
    print(-1)

Fixed submission:
#ABC065.B
N = int(input())
a = [int(input()) for i in range(N)]
x = 1
for i in range(N):
    x = a[x-1]
    if x == 2:
        print(i+1)
        break
else:
    print(-1)

Buggy python submission (verdict: Runtime Error):
#ABC065.B
N = int(input())
a = [int(input()) for i in range(N)]
x = 0
for i in range(N):
    x = a[x]
    if a[x] == 2:
        print(i+1)
        break
else:
    print(-1)

Fixed submission:
#ABC065.B
N = int(input())
a = [int(input()) for i in range(N)]
x = 1
for i in range(N):
    x = a[x-1]
    if x == 2:
        print(i+1)
        break
else:
    print(-1)

Buggy python submission (verdict: Runtime Error):
#ABC065.B
N = int(input())
a = [int(input() for i in range(N))]
x = 0
for i in range(N):
    x = a[x]
    if a[x] == 2:
        print(i+1)
        break
else:
    print(-1)

Fixed submission:
#ABC065.B
N = int(input())
a = [int(input()) for i in range(N)]
x = 1
for i in range(N):
    x = a[x-1]
    if x == 2:
        print(i+1)
        break
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
H,W = map(int,input().split())
print('#'*(W+2)
for i in range(H):
    a = input()
    print('#'+a+'#')
print('#'*(W+2))

Fixed submission:
#ABC062.B
H,W = map(int, input().split())
print('#'*(W+2))
for i in range(H):
    a = input()
    print('#'+a+'#')
print('#'*(W+2))
Buggy python submission (verdict: Runtime Error):
#ABC059.B
A = int(input())
B = int(input())

if A > B:
    print('GREATER')
elif A == B
    print('EQUAL')
else:
    print('LESS')

Fixed submission:
#ABC059.B
A = int(input())
B = int(input())

if A > B:
    print('GREATER')
elif A == B:
    print('EQUAL')
else:
    print('LESS')
Buggy python submission (verdict: Runtime Error):
#ABC057.B
N,M = map(int,input().split())
L1 = []
L2 = []

for i in range(N):
    a,b = map(int,input().split())
    L1.append([a,b])
for m in range(M):
    c,d = map(int,input().split())
    L2.append([c,d])

for j in range(N):
    L3 = []
    for l in range(M):
        L3.append(abs(L1[j][0]-L2[l][0]) + abs(L1[j][1]-L2[l][1]))
    print(L3.index(min(L3))+1)

Fixed submission:
#ABC057.A
A,B = map(int,input().split())
if A+B <24:
    print(A+B)
else:
    print(A+B-24)

Buggy python submission (verdict: Runtime Error):
#ABC057.B
N,M = map(int(input().split()))
L1 = []
L2 = []

for i in range(N):
    a,b = map(int,input().split())
    L1.append([a,b])
for m in range(M):
    c,d = map(int,input().split())
    L2.append([c,d])

for j in range(N):
    L3 = []
    for l in range(M):
        L3.append(abs(L1[j][0]-L2[l][0]) + abs(L1[j][1]-L2[l][1]))
    print(L3.index(min(L3)+1)

Fixed submission:
#ABC057.A
A,B = map(int,input().split())
if A+B <24:
    print(A+B)
else:
    print(A+B-24)
Buggy python submission (verdict: Runtime Error):
#ABC056.A
a,b = input().split()
if a == b:
    print('H')
else:
    prind('D')

Fixed submission:
#ABC056.A
a,b = input().split()
if a == b:
    print('H')
else:
    print('D')
Buggy python submission (verdict: Runtime Error):
W,a,b = map(int,input())
if a <= b <= a+W or a<= b+W <= a+W:
    print(0)
elif a+W < b:
    print(b-(a+W))
elif b+W <a:
    print(a-(b+W))

Fixed submission:
#ABC056.B
W,a,b = map(int,input().split())
if a<= b <= a+W or a <= b+W <= a+W:
    print(0)
elif a + W <b:
    print(b-(a+W))
elif b+W <a:
    print(a-(b+W))
Buggy python submission (verdict: Time Limit Exceeded):
#ABC055.B
N = int(input())
cnt = 1

for i in range(N):
    cnt = cnt*(i+1)

print(cnt%(10**9+7))

Fixed submission:
#ABC055.B
import math
N = int(input())
ans = math.factorial(N)%(10**9+7)
print(ans)
Buggy python submission (verdict: Runtime Error):
#ABC050.A
A,B = map(int,input().split())
op = input()
if op == '+':
    print(A+B)
else:
    print(A-B)

Fixed submission:
#ABC050.A
A,op,B = input().split()
if op =='+':
    print(int(A)+int(B))
else:
    print(int(A)-int(B))
Buggy python submission (verdict: Runtime Error):
N = int(input())
T = list(int(input().split()))
S = sum(T)
M = int(input())

for _ in range(M):
    p,x = map(int,input().split())
    ans = S - T[p-1] + x
    print(ans)

Fixed submission:
#ABC050.B
N =int(input())
T = list(map(int,input().split()))
S = sum(T)
M = int(input())

for _ in range(M):
    a = S
    p,x = map(int,input().split())
    a -= T[p-1]
    a += x
    print(a)

Buggy python submission (verdict: Runtime Error):
N = int(input())
T = list(int(input().split()))
S = sum(T)
M = int(input())

for _ in range(M):
    p,x = map(int,input().split())
    ans = S - T[] + x
    print(ans)

Fixed submission:
#ABC050.B
N =int(input())
T = list(map(int,input().split()))
S = sum(T)
M = int(input())

for _ in range(M):
    a = S
    p,x = map(int,input().split())
    a -= T[p-1]
    a += x
    print(a)

Buggy python submission (verdict: Runtime Error):
#ABC050.B
N = int(input())
T = int(input().split())
S = sum(T)
M = int(input())

for _ in range(M):
    p,x = map(int,input().split())
    ans = S - T[] + x[]
    print(ans)

Fixed submission:
#ABC050.B
N =int(input())
T = list(map(int,input().split()))
S = sum(T)
M = int(input())

for _ in range(M):
    a = S
    p,x = map(int,input().split())
    a -= T[p-1]
    a += x
    print(a)

Buggy python submission (verdict: Runtime Error):
#ABC050.B
N =int(input())
T = list(map(int,input().split()for _ in range(N)))
S = sum(T)
M = int(input())

for _ in range(M):
    a = S
    p,x = map(int,input().split())
    a -= T[p-1]
    a += x
    print(a)

Fixed submission:
#ABC050.B
N =int(input())
T = list(map(int,input().split()))
S = sum(T)
M = int(input())

for _ in range(M):
    a = S
    p,x = map(int,input().split())
    a -= T[p-1]
    a += x
    print(a)

Buggy python submission (verdict: Runtime Error):
#ABC050.B
N =int(input())
T = list(map(int,input().split()for _ in range(N)))
S = sum(T)
M = int(input())

for _ in range(M):
    p,x = map(int,input().split())
    S -= T[p-1]
    S += x
    print(S)

Fixed submission:
#ABC050.B
N =int(input())
T = list(map(int,input().split()))
S = sum(T)
M = int(input())

for _ in range(M):
    a = S
    p,x = map(int,input().split())
    a -= T[p-1]
    a += x
    print(a)
Buggy python submission (verdict: Runtime Error):
#ABC048.B
a,b,x = map(int,input().split())

print(b//x - (a-1)//x)

Fixed submission:
#ABC048.A
A,B,C= input().split()
print(A[0]+B[0]+C[0])
Buggy python submission (verdict: Runtime Error):
#ABC047.B
w,h,n = map(int,input().split())

#座標を作る
right = w
left = 0
upper = h
under = 0

for _ in range(n):
    x,y,a = map(int,input().split())

    if a ==1:
        left = max(x,left)
    elif a ==2:
        right = min (x,right)
    elif a ==3:
        under = max(y,under)
    elif a ==4:
        upper = min(y,upper)

if　(upper-under)>0 and (right-left)>0:
    c = (upper-under)*(right-left)
    print(c)
else:
    print(0)

Fixed submission:
#ABC047.B

w,h,n = map(int,input().split())
#座標を作る
right = w
left = 0
upper = h
under = 0

for _ in range(n):
    x,y,a = map(int,input().split())

    if a ==1:
        left = max(x,left)
    elif a ==2:
        right = min(x,right)
    elif a ==3:
        under = max(y,under)
    else:
        upper = min(y,upper)

if(upper-under)>0 and (right-left)>0:
    c = (upper-under)*(right-left)
    print(c)
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
#ABC047.B
w,h,n = map(int,input().split())

#座標を作る
right = w
left = 0
upper = h
under = 0

for _ in range(n):
    x,y,a = map(int,input().split())

if a ==1:
    left = max(x,left)
elif a ==2:
    right = min (x,right)
elif a ==3:
    under = max(y,under)
elif a ==4:
    upper = min(y,upper)

if　(upper-under)>0 and (right-left)>0:
    c = (upper-under)*(right-left)
    print(c)
else:
    print(0)

Fixed submission:
#ABC047.B

w,h,n = map(int,input().split())
#座標を作る
right = w
left = 0
upper = h
under = 0

for _ in range(n):
    x,y,a = map(int,input().split())

    if a ==1:
        left = max(x,left)
    elif a ==2:
        right = min(x,right)
    elif a ==3:
        under = max(y,under)
    else:
        upper = min(y,upper)

if(upper-under)>0 and (right-left)>0:
    c = (upper-under)*(right-left)
    print(c)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
#ABC046.A
a = int(input())
b = int(input())
c = int(input())

if a == b==c:
    print(1)
elif a == b !=c:
    print(2)
elif a ==c !=b:
    print(2)
elif b ==c!=a:
    print(2)
else:
    print(3)

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

if a == b==c:
    print(1)
elif a == b !=c:
    print(2)
elif a ==c !=b:
    print(2)
elif b ==c!=a:
    print(2)
else:
    print(3)
Buggy python submission (verdict: Runtime Error):
#ABC044.A
N,K,X,Y = map(int,input().split())
#N<=Kの時
if N <= K:
    total_1 = N*X
    print(total_1)
#N>Kの時
else:
    total_2 = K*X + (N-K)*Y
    print(total_2)

Fixed submission:
n = int(input())
k=int(input())
x = int(input())
y = int(input())

if n>k:
  total = k*x +(n-k)*y
  print(total)
else:
  total=n*x
  print(total)
Buggy python submission (verdict: Runtime Error):
A= int(input())
B= int(input())
C = int(input())

#575を作れるか判定
if A == B ==5 and C ==7:
    print('YES')
elif A ==C ==5 and B==7:
    print('YES')
elif A ==7 and B ==C ==5:
    print('YES')
    
else:
    print('NO')

Fixed submission:
#ABC.042A
a,b,c = map(int,input().split())
if a ==b==5 and c ==7:
    print('YES')
elif a ==c==5 and b ==7:
    print('YES')
elif b==c==5 and a ==7:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
#ABC042.B
N,L = map(int,input().split())
s = [input()for_in range(N)]
s.sort()
ans=''
for i in range(N):
    ans += s[i]
print(ans)

Fixed submission:
#ABC042.B
N,L = map(int,input().split())
s = [input()for _ in range(N)]
s.sort()
ans=''
for i in range(N):
    ans =ans +s[i]
print(ans)

Buggy python submission (verdict: Runtime Error):
#ABC042.B
N,L = map(int,input().split())
s = [input() for_in range(n)]
s.sort()
ans=''
for i in range(N):
    ans =ans+ s[i]
print(ans)

Fixed submission:
#ABC042.B
N,L = map(int,input().split())
s = [input()for _ in range(N)]
s.sort()
ans=''
for i in range(N):
    ans =ans +s[i]
print(ans)

Buggy python submission (verdict: Runtime Error):
#ABC042.B
N,L = map(int,input().split())
s = [input()for_in range(n)]
s.sort()
ans=''
for i in range(N):
    ans += s[i]
print(ans)

Fixed submission:
#ABC042.B
N,L = map(int,input().split())
s = [input()for _ in range(N)]
s.sort()
ans=''
for i in range(N):
    ans =ans +s[i]
print(ans)

Buggy python submission (verdict: Runtime Error):
#ABC042.B
N,L = map(int,input().split())
s = [input()for_in range(n)]
s.sort()
ans=''
for i in range(s):
    ans += s[i]
print(ans)

Fixed submission:
#ABC042.B
N,L = map(int,input().split())
s = [input()for _ in range(N)]
s.sort()
ans=''
for i in range(N):
    ans =ans +s[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
K = input()
(A, B) = map(int, input().split())
buf = True
for i in range(A, B + 1):
  if(i % K == 0):
    print("OK")
	return 
print("NG")

Fixed submission:
K = int(input())
(A, B) = map(int, input().split())
buf = True
for i in range(A, B + 1):
  if(i % K == 0):
    print("OK")
    buf = False
    break
if buf:
  print("NG")

Buggy python submission (verdict: Runtime Error):
K = input()
(A, B) = map(int, input.split())
buf = True
for i in range(A, B + 1):
  if(i % K == 0):
    print("OK")
	return 
print("NG")

Fixed submission:
K = int(input())
(A, B) = map(int, input().split())
buf = True
for i in range(A, B + 1):
  if(i % K == 0):
    print("OK")
    buf = False
    break
if buf:
  print("NG")
Buggy python submission (verdict: Runtime Error):
X = int(input())
y = 100
ans = 0
while(True):
  ans++
  y += y//100
  if(X<=y):
    break
print(ans)

Fixed submission:
X = int(input())
y = 100
ans = 0
while(True):
  ans+=1
  y += y//100
  if(X<=y):
    break
print(ans)
Buggy python submission (verdict: Runtime Error):
d = {}
ans = 0;
N = int(input())
for i in range(N):
    key = input()
    if key not in d:
        ans++
        d[key] = 0
        
        
print(ans)

Fixed submission:
d = {}
ans = 0;
N = int(input())
for i in range(N):
    key = input()
    if key not in d:
        ans+=1
        d[key] = 0
        
        
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 26 22:06:14 2020

@author: Masataka Amau
"""

N = int(input())
aaa = []
for i in range(N):
    buf = input()
    if(buf not in aaa):
        aaa.append(buf)
        
print(len(aaa))

Fixed submission:
d = {}
ans = 0;
N = int(input())
for i in range(N):
    key = input()
    if key not in d:
        ans+=1
        d[key] = 0
        
        
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 26 22:06:14 2020

@author: Masataka Amau
"""

N = int(input())
aaa = []
for i in range(N):
    buf = input()
    if(buf not in aaa):
        aaa.append(buf)
        
print(len(aaa))

Fixed submission:
d = {}
ans = 0;
N = int(input())
for i in range(N):
    key = input()
    if key not in d:
        ans+=1
        d[key] = 0
        
        
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
_ = input()
inp = map(int, input().split())

of = False
re = 1

for a in inp:
    re *= a


if (re - 1) // (10**18) > 0:
    re = -1

print(re)


Fixed submission:
_ = input()
inp = list(map(int, input().split()))

re = 1


for a in inp:
    re = re * a
    if re > (10**18):
        of = True
        re = -1
        break


for a in inp:
    if a == 0:
        re = 0


print(re)