Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):

"""
Writer: SPD_9X2
https://atcoder.jp/contests/abc044/tasks/arc060_b

f(b,n)ってbが大きくなるほど大きくなる？(単調増加になる?)
→そんなことはない
nより大きかったら不可能。最小はn進法で桁和1

3桁以上になる物は全探索する
2桁は、良い感じにすべて調べ上げる
実装だるそ～

2桁の時 xyとなるとする
n//b = x
n%b  = y

n = bx+y
x+y = s

(n-S)//x+1 = b
かつ S >= x >= S-b

xについてn-sの約数を全列挙して、bを求める & 下の条件を満たしているか確認すればよい？
"""

def f(b,n):

    if n < b:
        return n
    else:
        return f(b,n//b) + (n%b)

import sys
n = int(input())
s = int(input())

if s > n:
    print (-1)
    sys.exit()
elif s == n:
    print (n+1)
    sys.exit()

for b in range(2,int(n**0.5+10)):

    if f(b,n) == s:
        print (b)
        sys.exit()

#ここからだるいパート
ans = float("inf")

for x1 in range(1,s+1):

    if (n-s) % x1 == 0:

        x2 = (n-s)//x1

        b1 = (n-s)//x1+1
        if b1 ** 2 > n and s >= x1 >= s-b1:
            ans = min(ans , b1)

        b2 = (n-s)//x2+1
        if b2 **2 > n and s >= x2 >= s-b2:
            ans = min(ans , b2)

if ans == float("inf"):
    print (-1)
else:
    print (ans)


Fixed submission:

"""
Writer: SPD_9X2
https://atcoder.jp/contests/abc044/tasks/arc060_b

f(b,n)ってbが大きくなるほど大きくなる？(単調増加になる?)
→そんなことはない
nより大きかったら不可能。最小はn進法で桁和1

3桁以上になる物は全探索する
2桁は、良い感じにすべて調べ上げる
実装だるそ～

2桁の時 xyとなるとする
n//b = x
n%b  = y

n = bx+y
x+y = s

(n-S)//x+1 = b
かつ S >= x >= S-b

xについてn-sの約数を全列挙して、bを求める & 下の条件を満たしているか確認すればよい？
上の条件を満たしているbが必ずしも元の条件を満たすわけではなさそう？
ちゃんと満たしているか確認してあげる
"""

def f(b,n):

    if n < b:
        return n
    else:
        return f(b,n//b) + (n%b)

import sys
n = int(input())
s = int(input())

if s > n:
    print (-1)
    sys.exit()
elif s == n:
    print (n+1)
    sys.exit()

for b in range(2,int(n**0.5+10)):

    if f(b,n) == s:
        print (b)
        sys.exit()

#ここからだるいパート
ans = float("inf")

for x1 in range(1,10**6):

    if (n-s) % x1 == 0:

        x2 = (n-s)//x1

        b1 = (n-s)//x1+1
        if b1 ** 2 > n and s >= x1 >= s-b1 and f(b1,n) == s:
            ans = min(ans , b1)

        b2 = (n-s)//x2+1
        if b2 **2 > n and s >= x2 >= s-b2 and f(b2,n) == s:
            ans = min(ans , b2)

if ans == float("inf"):
    print (-1)
else:
    print (ans)
Buggy python submission (verdict: Runtime Error):
import bisect

def wantp(p,day,db):

    for i in range(len(db)):
        i = len(db)-1-i

        if day & (2 ** i) > 0:
            p = db[i][p]

    return p

N = int(input())

x = list(map(int,input().split()))

L = int(input())

able = []

for i in range(N):

    able.append(bisect.bisect_right(x,x[i] + L) - 1)

#print (able)

db = [able]

while min(db[-1]) != N-1:

    new = []

    for i in range(N):

        new.append(db[-1][db[-1][i]])

    db.append(new)

db1 = db.copy()

for i in range(N):
    x[i] = x[-1] - x[i]
x.reverse()
#print (x)

able = []
for i in range(N):
    able.append(bisect.bisect_right(x,x[i] + L) - 1)
db = [able]
while min(db[-1]) != N-1:
    new = []
    for i in range(N):
        new.append(db[-1][db[-1][i]])
    db.append(new)
db2 = db
#print (db2)


Q = int(input())

for loop in range(Q):

    a,b = map(int,input().split())
    a -= 1
    b -= 1

    if a < b:

        l = 0
        r = N+1

        while r-l != 1:

            m = (l+r) // 2

            np = wantp(a,m,db1)
            #print (a,m,np)

            if np < b:
                l = m
            else:
                r = m

        print (r)

    else:
        a = N-1-a
        b = N-1-b

        l = 0
        r = N+1

        while r-l != 1:

            m = (l+r) // 2

            np = wantp(a,m,db2)
            #print (a,m,np)

            if np < b:
                l = m
            else:
                r = m

        print (r)



    


Fixed submission:
import bisect

def wantp(p,day):

    for i in range(len(db)):
        i = len(db)-1-i

        if day & (2 ** i) > 0:
            p = db[i][p]

        #print (day,i)

    return p


N = int(input())
x = list(map(int,input().split()))
L = int(input())

able = []

for i in range(N):

    able.append(bisect.bisect_right(x,x[i] + L) - 1)


db = [able]

while min(db[-1]) != N-1:

    new = []

    for i in range(N):

        new.append(db[-1][db[-1][i]])

    db.append(new)


Q = int(input())

for loop in range(Q):

    a,b = map(int,input().split())
    if a > b:
        t = a
        a = b
        b = t
    a -= 1
    b -= 1

    l = 0
    r = 2 ** len(db)

    while r-l != 1:

        m = (l+r) // 2

        np = wantp(a,m)
        #print (a,m,np)

        if np < b:
            l = m
        else:
            r = m

    print (r)
Buggy python submission (verdict: Runtime Error):
a,b,c,d,e = map(int,input.split())
print((c*60+d)-(a*60+b)-e)

Fixed submission:
a,b,c,d,e = map(int,input().split())
print((c*60+d)-(a*60+b)-e)

Buggy python submission (verdict: Runtime Error):
a,b = map(int,input.split())
c,d = map(int,input.split())
e = int(input())
print((c*60+d)-(a*60+b)-e)

Fixed submission:
a,b,c,d,e = map(int,input().split())
print((c*60+d)-(a*60+b)-e)
Buggy python submission (verdict: Runtime Error):
a = input()
print(a.replace("?","D")

Fixed submission:
a = input()
print(a.replace("?","D"))
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = a%10
print("hon" if b == 2,4,5,7,9 else "pon" if b == 0,1,6,8 else "bon")

Fixed submission:
a = int(input())
b = a%10
print("hon" if b in [2,4,5,7,9] else "pon" if b in [0,1,6,8] else "bon")

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = a%10
print("hon" if b = 2,4,5,7,9 else "pon" if b = 0,1,6,8 else "bon")

Fixed submission:
a = int(input())
b = a%10
print("hon" if b in [2,4,5,7,9] else "pon" if b in [0,1,6,8] else "bon")
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
import math
rad = math.fabs((c/12 - d/60)*360)
rad = min(rad,360-rad)
cosine = (math.cos(math.radians(rad))
print((a**2+b**2 - 2*a*b*cosine)**0.5)

Fixed submission:
a,b,c,d = map(int,input().split())
import math
rad = math.fabs((c/12 - d/60 + d/720)*360)
rad = min(rad,360-rad)/180
cosine = math.cos(rad*math.pi)
print((a**2+b**2 - 2*a*b*cosine)**0.5)
Buggy python submission (verdict: Runtime Error):
N = int(input())
total = 0
for i in range(1,N+1)
    if (i%3) != 0 and (i%5) ! =0:
        total += i
print(total)

Fixed submission:
N = int(input())
total = 0
for i in range(1, N+1):
    if (i % 3) != 0 and (i % 5) != 0:
        total = total+i
print(total)

Buggy python submission (verdict: Runtime Error):
N = int(input())
total = 0
for i in range(1,N+1)
    if i%3 != 0 and i%5 ! =0:
        total += i
print(total)

Fixed submission:
N = int(input())
total = 0
for i in range(1, N+1):
    if (i % 3) != 0 and (i % 5) != 0:
        total = total+i
print(total)

Buggy python submission (verdict: Runtime Error):
N = int(input())
total = 0
for i in range(1,N+1)
    if i%3!=0 and i%5!=0:
        total += i
print(total)

Fixed submission:
N = int(input())
total = 0
for i in range(1, N+1):
    if (i % 3) != 0 and (i % 5) != 0:
        total = total+i
print(total)

Buggy python submission (verdict: Runtime Error):
N = int(input())
total = 0
for i in range(1,N+1):
	if i%3!=0 and i%5!=0:
    	total += i
print(total)

Fixed submission:
N = int(input())
total = 0
for i in range(1, N+1):
    if (i % 3) != 0 and (i % 5) != 0:
        total = total+i
print(total)

Buggy python submission (verdict: Runtime Error):
N = int(input())
total = 0
for i in range(1,N+1):
	if i%3!=0 and i%5!=0:
    	total = total + 1
print(total)

Fixed submission:
N = int(input())
total = 0
for i in range(1, N+1):
    if (i % 3) != 0 and (i % 5) != 0:
        total = total+i
print(total)

Buggy python submission (verdict: Runtime Error):
N = int(input())
total = 0
for i in range(1,N+1):
	if i%3!=0 and i%5!=0:
    	total +=i
print(total)

Fixed submission:
N = int(input())
total = 0
for i in range(1, N+1):
    if (i % 3) != 0 and (i % 5) != 0:
        total = total+i
print(total)

Buggy python submission (verdict: Runtime Error):
N = int(input())
total = 0
for i in range(1,N+1):
	if i%3 != 0 and i%5! = 0:
		total += i
print(total)    

Fixed submission:
N = int(input())
total = 0
for i in range(1, N+1):
    if (i % 3) != 0 and (i % 5) != 0:
        total = total+i
print(total)

Buggy python submission (verdict: Runtime Error):
N = int(input())
total = 0
for i in range(1,N+1):
	if i%3!=0 and i%5!=0:
    	total += i
print(total)    

Fixed submission:
N = int(input())
total = 0
for i in range(1, N+1):
    if (i % 3) != 0 and (i % 5) != 0:
        total = total+i
print(total)

Buggy python submission (verdict: Runtime Error):
N = int(input())
total = 0
for i in range(1,N+1):
	if N%3!=0 and N%5!=0:
    	total += i
print(total)    

Fixed submission:
N = int(input())
total = 0
for i in range(1, N+1):
    if (i % 3) != 0 and (i % 5) != 0:
        total = total+i
print(total)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = input()
if a%2 == 0:
  print("Yes" if b[:(a/2)] == b[(a/2):] else "No")
else:
  print("No")

Fixed submission:
a = int(input())
b = input()
if a%2 == 0:
  print("Yes" if b[:int(a/2)] == b[int(a/2):] else "No")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = input()
if a%2 == 0:
  print("Yes" if a[:(a/2)] == a[(a/2):] else "No")
else:
  print("No")

Fixed submission:
a = int(input())
b = input()
if a%2 == 0:
  print("Yes" if b[:int(a/2)] == b[int(a/2):] else "No")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = input()
if a%2 == 0:
  print("Yes" if a[:(a/2-1)] == a[(a/2):] else "No")
else:
  print("No")

Fixed submission:
a = int(input())
b = input()
if a%2 == 0:
  print("Yes" if b[:int(a/2)] == b[int(a/2):] else "No")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = [list(map(int, input().split())) for i in range(a)]
import math
c = math.factorial(a)//(a-1)
count = 0
for i in range(a-1):
  for j in range(i+1:a):
    count += ((b[i][0]-b[j][0])*2+(b[i][1]-b[j][1])*2)*0.5
print(count*c)

Fixed submission:
N = int(input())

P = []

S = 0

for i in range(N):
   P.append(list(map(int,input().split())))


for i in range(N-1):
   for j in range(N-1-i):
       
       S += (((P[i][0] - P[i+j+1][0])**2 + (P[i][1] - P[i+j+1][1])**2)**0.5)*2
       
print(S/N)
Buggy python submission (verdict: Runtime Error):
a = int(input())
i = 1
while i < 10:
  if a%i = 0 and 1<= a//i <=9:
    print("Yes")
    break
  else:
    i += 1

Fixed submission:
a = int(input())
i = 1
while i < 10:
  if a%i == 0 and 1<= a//i <=9:
    print("Yes")
    break
  else:
    i += 1
if i >=10:
    print("No")
Buggy python submission (verdict: Runtime Error):
a,b = map(int.input().split())
for i in range(b-a+1,b+a):
  print(i,end=' ')

Fixed submission:
a,b = map(int,input().split())
for i in range(b-a+1,b+a):
  print(i)

Buggy python submission (verdict: Runtime Error):
a,b = map(int.input().split())
for i in range(b-a+1,b+a):
  print(i)

Fixed submission:
a,b = map(int,input().split())
for i in range(b-a+1,b+a):
  print(i)

Buggy python submission (verdict: Runtime Error):
a,b = map(int.input().split())
for i in range(b-a+1,b+a):
  print(i)

Fixed submission:
a,b = map(int,input().split())
for i in range(b-a+1,b+a):
  print(i)
Buggy python submission (verdict: Runtime Error):
s = input()
count = 0
for i in range(4):
  if s[i] == +:
    count += 1
  else:
    count -=1
print(count)

Fixed submission:
s = input()
count = 0
for i in range(4):
  if s[i] == "+":
    count += 1
  else:
    count -=1
print(count)
Buggy python submission (verdict: Runtime Error):
a = input()
print("Yes" if a[0]=a[1]=a[2] or a[1]=a[2]=a[3] else "No")

Fixed submission:
a = input()
print("Yes" if a[0]==a[1]==a[2] or a[1]==a[2]==a[3] else "No")
Buggy python submission (verdict: Runtime Error):
a = int(input())
print("Yes" if 9 in a else "No")

Fixed submission:
a = input()
print("Yes" if "9" in a else "No")
Buggy python submission (verdict: Runtime Error):
s = input()
print(s[0]+str(len(s)-2)+s[len(s)])

Fixed submission:
s = input()
print(s[0]+str(len(s)-2)+s[-1])
Buggy python submission (verdict: Runtime Error):
print(*list[input().split(",")])

Fixed submission:
a,b,c = input().split(",")
print(a,b,c)

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

Fixed submission:
a,b,c = input().split(",")
print(a,b,c)
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
k = int(math.sqrt(n)) if n != k ** 2 else int(math.sqrt(n)) - 1
ans = 0
for i in range(1, k + 1):
    t = int((n - 1) / i)
    ans += (t- i + 1) * 2
    if n != i ** 2:
        ans -= 1 
print(ans)

Fixed submission:
import math
n = int(input())
m = int(math.sqrt(n))
if n == m ** 2:
    m -= 1

ans = 0
for i in range(1, m + 1):
    t = int((n - 1) / i)
    ans += (t- i + 1) * 2
    if n != i ** 2:
        ans -= 1 
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
k = int(math.sqrt(n)) if n != k ** 2 else int(math.sqrt(n)) - 1
ans = 0
for i in range(1, k + 1):
    t = int((n - 1) / i)
    ans += (t- i + 1) * 2
    if n != i ** 2:
        ans -= 1 
print(ans)

Fixed submission:
import math
n = int(input())
m = int(math.sqrt(n))
if n == m ** 2:
    m -= 1

ans = 0
for i in range(1, m + 1):
    t = int((n - 1) / i)
    ans += (t- i + 1) * 2
    if n != i ** 2:
        ans -= 1 
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
ns = []
for i in range(k):
    l, r = map(int,input().split())
    for k in range(l, r+1):
        ns.append(k)
arr = [0 for i in range(n)]
arr[0] = 1
for i in range(n):
    for j in ns:
        if i + j < n:
            arr[i + j] += arr[i]
print(arr[n-1] % 998244353)

Fixed submission:
MOD = 998244353
n,k = map(int,input().split())
ns = [list(map(int,input().split())) for i in range(k)]
    
dp = [0 for j in range(n+1)]
cum = [0 for j in range(n+1)]
dp[1] = 1
cum[1] = 1
for i in range(2, n+1):
    for j in range(k):
        l, r = ns[j]
        if i - l >= 0:
            dp[i] += cum[i-l]
        if i - (r+1) >= 0:
            dp[i] -= cum[i-(r+1)]
    dp[i] = (dp[i] % MOD + MOD) % MOD
    cum[i] = (cum[i-1] + dp[i]) % MOD
print(dp[n])
Buggy python submission (verdict: Time Limit Exceeded):
n, x, m = map(int, input().split())
arr = [x]
mod = x

def find_value(lst, value):
    return [i for i, x in enumerate(lst) if x == value]

ans = 0
for i in range(n-1):
    mod = mod ** 2 % m
    res = find_value(arr, mod)

    if res: 
        j = res[0]
        a = i + 1 - j
        q, mod = divmod((n - j), a)
        ans = sum(arr[0:j]) + q * sum(arr[j:j+a]) + sum(arr[j:j+mod])
        break
    arr.append(mod)

if ans == 0:
    ans = sum(arr)

print(ans)

Fixed submission:
n, x, m = map(int, input().split())
arr = [x]
mod = x
memo = [-1 for _ in range(m+1)]

ans = 0
for i in range(1, n):
    mod = mod ** 2 % m
    idx = memo[mod]

    if idx != -1:
        a = i - idx
        q, _mod = divmod((n - idx), a)

        ans = sum(arr[0:idx]) + q * sum(arr[idx:idx+a]) + sum(arr[idx:idx+_mod])
        break
    arr.append(mod)
    memo[mod] = i

if ans == 0:
    ans = sum(arr)

print(ans)
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()

for i in range(len(T)):
  if i == 0:
    if T[:len(T)-i] in S:
      print(0)
  else:
    if T[:len(T)-i] in S and S[len(T)-i+1] != T[:len(T)-i]:
      print(i)

Fixed submission:
S = input()
T = input()

ans = len(T)

for i in range(len(S)-len(T)+1):
  tmp = len(T)
  for j in range(len(T)):
    if T[j] == S[i+j]:
      tmp -= 1
      ans = min(ans,tmp)
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))

mod= 10**9+7

A = sum(a)

ans=0

for i in a:
  A -= i
  A%=mod
  ans += A*x
  ans%=mod
print(ans)
  


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

mod= 10**9+7

A = sum(a)

ans=0

for i in a:
  A -= i
  A%=mod
  ans += A*i
  ans%=mod
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))

sum=0
mod = 1000000007

def permod(x):
  return x%mod
B = list(map(permod,A))

for i in range(1,N+1):
    for j in range(1,N+1):
        if i < j:
            sum += B[i-1]*B[j-1]
            sum = sum %mod
print(sum)

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

mod= 10**9+7

A = sum(a)

ans=0

for i in a:
  A -= i
  A%=mod
  ans += A*i
  ans%=mod
print(ans)

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

N = int(input())
A = list(map(int,input().split()))

sum=0
mod = 1000000007

def permod(x):
  return x%mod
B = list(map(permod,A))

for v in itertools.combinations(B, 2):
    sum +=v[0]*v[1]
    sum = sum %mod
print(sum)

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

mod= 10**9+7

A = sum(a)

ans=0

for i in a:
  A -= i
  A%=mod
  ans += A*i
  ans%=mod
print(ans)

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

N = int(input())
A = list(map(int,input().split()))

sum=0
mod = 1000000007
for v in itertools.combinations(A, 2):
    sum +=v[0]%mod *v[1]%mod
    sum = sum %mod
print(sum)


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

mod= 10**9+7

A = sum(a)

ans=0

for i in a:
  A -= i
  A%=mod
  ans += A*i
  ans%=mod
print(ans)

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

N = int(input())
A = list(map(int,input().split()))

sum=0
for v in itertools.combinations(A, 2):
    sum +=v[0]*v[1]
    sum = sum %(10**9 +7)
print(sum)

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

mod= 10**9+7

A = sum(a)

ans=0

for i in a:
  A -= i
  A%=mod
  ans += A*i
  ans%=mod
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
sum = 0
for i in range(1,N+1):
    for j in range(1,N+1):
        if i < j:
            sum += A[i-1]*A[j-1]
            sum = sum%(10**9+7)
print(sum)


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

mod= 10**9+7

A = sum(a)

ans=0

for i in a:
  A -= i
  A%=mod
  ans += A*i
  ans%=mod
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
sum = 0
for i in range(1,N+1):
    for j in range(1,N+1):
        if i < j:
            sum += A[i-1]*A[j-1]
print(sum%(10**9+7))

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

mod= 10**9+7

A = sum(a)

ans=0

for i in a:
  A -= i
  A%=mod
  ans += A*i
  ans%=mod
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
if int(str(N)[1:]) ==0:
  print(0)
else:
    print(1000-int(str(N)[1:])) 

Fixed submission:
N = int(input())
if 1 <= N <= 999:
  print(1000-N)
elif int(str(N)[1:]) ==0:
  print(0)
else:
    print(1000-int(str(N)[1:]))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A =[map(int,input().split())]

ans =1

for i in A:
  ans = i *ans
  if ans > 10**18:
    break
    print(-1)

print(ans)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))

limit = 10 ** 18
A.sort()
result = A[0]
for a in A[1:]:
  result *= a
  if result > limit:
    print(-1)
    exit()
print(result)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
from operator import mul
from functools import reduce
 
ans = reduce(mul, A) #結果=>120
 
if ans > 10**18 :
  print(-1)
else:
  print(ans)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))

limit = 10 ** 18
A.sort()
result = A[0]
for a in A[1:]:
  result *= a
  if result > limit:
    print(-1)
    exit()
print(result)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
from operator import mul
from functools import reduce

ans = reduce(mul, A) #結果=>120

if ans > 10**18 :
  print(-1)
else:
  print(ans)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))

limit = 10 ** 18
A.sort()
result = A[0]
for a in A[1:]:
  result *= a
  if result > limit:
    print(-1)
    exit()
print(result)
Buggy python submission (verdict: Runtime Error):
K = int(input())
A,B = map(int,input().split())
 
if A%K==0 or B%K==0 or B-A >= K　and A <= K <= B:
  print('OK')
else:
  print('NG')

Fixed submission:
K = int(input())
A,B = map(int,input().split())

count = 0

for i in range(A,B+1):
  if i%K ==0:
    count +=1
  else:
    count+=0

if count >0:
  print('OK')
else:
  print('NG')
Buggy python submission (verdict: Runtime Error):
import math
X = int(input())

def f(x):
  return math.log(x)/100.01

print(math.ceil(f(x)))

Fixed submission:
X = int(input())
count = 0
money =100

while True:
  money = int(money*1.01)
  count +=1
  if money >= X:
    break
print(count)
Buggy python submission (verdict: Runtime Error):
S = input()
W = input()

if int(S) <= int(W):
  print('unsafe')
elif int(S) > int(W):
  print('safe')
  

Fixed submission:
S,W=(int(x) for x in input().split())

if S <= W:
  print('unsafe')
else:
  print('safe')

Buggy python submission (verdict: Runtime Error):
if S <= W:
  print('unsafe')
else:
  print('safe')

Fixed submission:
S,W=(int(x) for x in input().split())

if S <= W:
  print('unsafe')
else:
  print('safe')

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

if (S <= W) and 0 <= S,W <= 100: 
    print('unsafe')
else:
    print('safe')

Fixed submission:
S,W=(int(x) for x in input().split())

if S <= W:
  print('unsafe')
else:
  print('safe')

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

if S <=W:
    print('unsafe')
else:
    print('safe')

Fixed submission:
S,W=(int(x) for x in input().split())

if S <= W:
  print('unsafe')
else:
  print('safe')

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

if S <= W:
  print('unsafe')
else:
  print('safe')


Fixed submission:
S,W=(int(x) for x in input().split())

if S <= W:
  print('unsafe')
else:
  print('safe')

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

if S <= W:
  print('unsafe')
else:
  print("safe")

Fixed submission:
S,W=(int(x) for x in input().split())

if S <= W:
  print('unsafe')
else:
  print('safe')

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

if s =< w:
  print("unsafe")
else:
  print("safe)

Fixed submission:
S,W=(int(x) for x in input().split())

if S <= W:
  print('unsafe')
else:
  print('safe')

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

if s =< w:
  print("unsafe")
else:
  print("safe")

Fixed submission:
S,W=(int(x) for x in input().split())

if S <= W:
  print('unsafe')
else:
  print('safe')
Buggy python submission (verdict: Runtime Error):
N = int(input())
S =[input() for i in range(N+1)]

s = set(S)

print(len(s))

Fixed submission:
N = int(input())
S =[input() for i in range(N)]

s = set(S)

print(len(s))