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

n=int(input())
a=list(map(int,input().split()))
b=[a[i]-(i+1) for i in range(n)]
sumb2=0
sum2=0
for bb in b:
    sumb2 += (bb**2)

for bb in b:
    sum2+=bb*2
bb=[math.ceil(sum2/(2*n)), math.floor(sum2/(2*n))]
ans=math.inf

for bbb in bb:
    sumans=0
    for aa in b:
        sumans+=(math.fabs(aa-bbb))
    ans=min(ans,sumans)

print(int(ans))
    


Fixed submission:
import statistics
import math

n=int(input())
a=list(map(int,input().split()))
b=[a[i]-(i+1) for i in range(n)]
midb=statistics.median(sorted(b))
ans=0

for bb in b:
    ans+=math.fabs(bb-midb)
print(int(ans))
Buggy python submission (verdict: Runtime Error):
d,n=map(int,input().split)
print(100*d*n)


Fixed submission:
d,n=map(int,input().split())
if n==100:
    n+=1
print(n*100**d)
Buggy python submission (verdict: Time Limit Exceeded):
import heapq

s=input()
k=int(input())
n=len(s)
ans=set()

for i in range(n+1):
    for j in range(1,n+1):
        ans.add(s[i:j])

ans.remove('')

ansh=[]
for ss in ans:
    heapq.heappush(ansh,ss)
for _ in range(k-1):
    heapq.heappop(ansh)
print(ansh[0])


Fixed submission:
import heapq

s=input()
k=int(input())
n=len(s)
ans=set()

for i in range(n+1):
    j=1
    while j<=k and i+j<=n:
        ans.add(s[i:i+j])
        j+=1


ansh=[]
for ss in ans:
    heapq.heappush(ansh,ss)
for _ in range(k-1):
    heapq.heappop(ansh)
print(ansh[0])

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

s=input()
k=int(input())
n=len(s)
ans=set()

for i in range(n):
    for j in range(1,n+1):
        ans.add(s[i:j])

ans.remove('')

ansh=[]
for ss in ans:
    heapq.heappush(ansh,ss)
    

for _ in range(k-1):
    heapq.heappop(ansh)
print(ansh[0])


Fixed submission:
import heapq

s=input()
k=int(input())
n=len(s)
ans=set()

for i in range(n+1):
    j=1
    while j<=k and i+j<=n:
        ans.add(s[i:i+j])
        j+=1


ansh=[]
for ss in ans:
    heapq.heappush(ansh,ss)
for _ in range(k-1):
    heapq.heappop(ansh)
print(ansh[0])
Buggy python submission (verdict: Runtime Error):
def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1


primeN = [2]
for i in range(2,10000):
    for j in range(len(primeN)):
        if i % primeN[j] == 0:
            break
        else:
            if j == len(primeN) - 1:
                primeN.append(i)
n=int(input())
ans=[]

for i  in primeN:
    if i%5==1:
      ans.append(i)
    if len(ans)==n:
        for x in ans:
            print(x,end=" ")
        exit()
    


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

ans=a
if b<a:
    ans-=1
print(ans)
Buggy python submission (verdict: Runtime Error):
def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1


primeN = [2]
for i in range(2,1000):
    for j in range(len(primeN)):
        if i % primeN[j] == 0:
            break
        else:
            if j == len(primeN) - 1:
                primeN.append(i)
n=int(input())


for i in range(len(primeN)):
    if is_prime(sum(primeN[i:i+n+1])):
        for x in range(n):
            print(primeN[i+x])
        exit()


Fixed submission:
def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1


primeN = [2]
for i in range(2,10000):
    for j in range(len(primeN)):
        if i % primeN[j] == 0:
            break
        else:
            if j == len(primeN) - 1:
                primeN.append(i)
n=int(input())
ans=[]

for i  in primeN:
    if i%5==1:
      ans.append(i)
    if len(ans)==n:
        for x in ans:
            print(x,end=" ")
        exit()
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
b=list(map(int,input().split()))

if n==2:
    print(b[1])
    print(b[0])
    exit()
    
bs=sorted(b,reverse=True)

bl=[]
for i in b:
    indexb=bs.index(i)
    bl.append(indexb)
    bs[indexb]=-1
bs=sorted(bl[1:n])
mid=bs[n//2-1]
bd=dict(zip(bl,b))
print(bd[mid])

for i in range(1,n):
    if bl[i-1]>=mid>=bl[i]:
        mid+=1
    elif bl[i-1]<=mid<=bl[i]:
        mid-=1
    print(bd[mid])





Fixed submission:
n = int(input())
x = list(map(int, input().split()))
 
y = sorted(x)
 
for i in x:
    if i < y[n // 2]:
        print(y[n // 2])
    else:
        print(y[n // 2 - 1])
Buggy python submission (verdict: Time Limit Exceeded):
a,b,k=map(int,input().split())

for n in range(a,b+1):
    if n<a+k or b-k<n:
        print(n)


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

if a+k>b-k:
    for n in range(a,b+1):
        print(n)
else:
    for n in range(a,a+k):
        print(n)
    for n in range(b-k+1,b+1):
        print(n)
Buggy python submission (verdict: Time Limit Exceeded):
import heapq

n,k=map(int,raw_input().split())
a=map(int,raw_input().split())
res = [(a.count(e),e) for e in set(a)]
div=max(0,len(res)-k)
heapq.heapify(res)
ans=0
while div>0:
    ans+=heapq.heappop(res)[0]
    div-=1
print ans


Fixed submission:
import heapq

n,k=map(int,raw_input().split())
a=map(int,raw_input().split())



d={}
for i in a:
    if i in d:
        d[i]+=1
    else:
        d[i]=1
l=d.values()
div=max(0,len(l)-k)
if div==0:
    print 0
    exit()


heapq.heapify(l)

ans=0
while div>0:
    ans+=heapq.heappop(l)
    div-=1
print ans

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,raw_input().split())
a=map(int,raw_input().split())

res = [(a.count(e),e) for e in set(a)]
div=max(0,len(res)-k)

resl=sorted(res,key=lambda x:x[0],reverse=True)
ans=0
while div>0:
    ans+=resl[-1][0]
    resl.pop()
    div-=1
print ans



Fixed submission:
import heapq

n,k=map(int,raw_input().split())
a=map(int,raw_input().split())



d={}
for i in a:
    if i in d:
        d[i]+=1
    else:
        d[i]=1
l=d.values()
div=max(0,len(l)-k)
if div==0:
    print 0
    exit()


heapq.heapify(l)

ans=0
while div>0:
    ans+=heapq.heappop(l)
    div-=1
print ans

Buggy python submission (verdict: Runtime Error):
n,k=map(int,raw_input().split())
a=map(int,raw_input().split())
aa=len(set(a))

div=max(0,int(aa)-k)
res = [(a.count(e),e) for e in aa if a.count(e) > 0]
resl=sorted(res,key=lambda x:x[0],reverse=True)
ans=0
while div>0:
    ans+=resl[-1][0]
    resl.pop()
    div=div-1

print ans


Fixed submission:
import heapq

n,k=map(int,raw_input().split())
a=map(int,raw_input().split())



d={}
for i in a:
    if i in d:
        d[i]+=1
    else:
        d[i]=1
l=d.values()
div=max(0,len(l)-k)
if div==0:
    print 0
    exit()


heapq.heapify(l)

ans=0
while div>0:
    ans+=heapq.heappop(l)
    div-=1
print ans

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,raw_input().split())
a=map(int,raw_input().split())
aa=len(set(a))

div=max(0,int(aa)-k)
res = [(a.count(e),e) for e in set(a) if a.count(e) > 0]
resl=sorted(res,key=lambda x:x[0],reverse=True)
ans=0
while div>0:
    ans+=resl[-1][0]
    resl.pop()
    div=div-1

print ans


Fixed submission:
import heapq

n,k=map(int,raw_input().split())
a=map(int,raw_input().split())



d={}
for i in a:
    if i in d:
        d[i]+=1
    else:
        d[i]=1
l=d.values()
div=max(0,len(l)-k)
if div==0:
    print 0
    exit()


heapq.heapify(l)

ans=0
while div>0:
    ans+=heapq.heappop(l)
    div-=1
print ans
Buggy python submission (verdict: Runtime Error):
N,A,B=map(int,input())
print(min(N*A,B))


Fixed submission:
N,A,B=map(int,input().split())
print(min(N*A,B))

Buggy python submission (verdict: Runtime Error):
N,A,B=map(int,input())
print(min(N*A,B))


Fixed submission:
N,A,B=map(int,input().split())
print(min(N*A,B))
Buggy python submission (verdict: Runtime Error):
A, B, C, D, E, F = map(int, input().split())
A, B = 100 * A, 100 * B
W = set()
S = set()

for i in range(F // A+1):
    for j in range(F // B+1):
        w = A * i + B * j
        if w <= F:
            W.add(w)

for i in range(F // C+1):
    for j in range(F // D+1):
        s = C * i + D * j
        if s <= F:
            S.add(s)

S.remove(0)
W.remove(0)
max_rat = -24
for w in W:
    for s in S:
        if w + s <= F and s <= w / 100 * E:
            rat = s / (s + w)
            if rat > max_rat:
                x, y, max_rat = w, s, rat

print(x + y, y)


Fixed submission:
A, B, C, D, E, F = map(int, input().split())
A, B = 100 * A, 100 * B
W = set()
S = set()

for i in range(F // A+1):
    for j in range(F // B+1):
        w = A * i + B * j
        if w <= F:
            W.add(w)

for i in range(F // C+1):
    for j in range(F // D+1):
        s = C * i + D * j
        if s <= F:
            S.add(s)

max_rat = -24
for w in W:
    for s in S:
        if w + s <= F and s <= w / 100 * E and s+w!=0:
            rat = s / (s + w)
            if rat > max_rat:
                x, y, max_rat = w, s, rat

print(x + y, y)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
a.sort()
ans=1

for i in range(n-1):
    cnt=0
    for j in range(i,n-1):
        if abs(a[i]-a[j])<=2:
            cnt+=1

    ans=max(ans,cnt)
print(ans)


Fixed submission:
from collections import Counter
n=int(input())
a=list(map(int,input().split()))
c=Counter(a)

ans=1

for x in range(1,10**5):
    ans=max(c[x-1]+c[x]+c[x+1],ans)
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
import functools
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return functools.reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return functools.reduce(lcm_base, numbers, 1)



n=int(input())
t=[]
for i in range(n):
    t.append(int(input()))
print(lcm_list(t))


Fixed submission:
import functools

def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)
def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm(*numbers):
    return functools.reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return functools.reduce(lcm_base, numbers, 1)



n=int(input())
t=[]
for i in range(n):
    t.append(int(input()))
print(lcm_list(t))
Buggy python submission (verdict: Time Limit Exceeded):
import functools

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


def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a

mod=functools.reduce(gcd,A)

tmp=0
amax=max(A)
while 1:
  if amax-mod*tmp==K:
    print('POSSIBLE')
    exit()
  elif amax-mod*tmp<0:
    break
  tmp+=1
print('IMPOSSIBLE')


Fixed submission:
import functools
from fractions import gcd
N,K=map(int,input().split())
A=list(map(int,input().split()))


mod=functools.reduce(gcd,A)

tmp=0
if max(A)>=K and K%mod==0:
  print('POSSIBLE')
else:
  print('IMPOSSIBLE')
Buggy python submission (verdict: Runtime Error):
n,p=map(int,input().split())
a=list(map(int,input().split()))
print(2**(N-1))

Fixed submission:
n,p=map(int,input().split())
a=list(map(lambda x: x%2, map(int,input().split())))
e=a.count(0)

ans=2**(n-1)
if p==1 and e==n:
    ans=0
if p==0 and e==n:
    ans=2**n
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
b=[]

for i in a:
    b.append(i)
    b=list(reversed(b))
bstr=' '.join(str(x) for x in b)
print(bstr)


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

i=n-1
while i>=0:
    b.append(a[i])
    i-=2

i=n%2
while i<n:
    b.append(a[i])
    i+=2

bstr=" ".join(str(x) for x in b)
print(bstr)
Buggy python submission (verdict: Time Limit Exceeded):

from collections import Counter
mod=10**9+7
N=10**5+11
fac,finv,inv = [0]*N,[0]*N,[0]*N

def cmb_init():
        fac[0]=fac[1]=finv[0]=finv[1]=inv[1]=1
        for i in range(2,N):
                fac[i] = fac[i-1]*i%mod
                inv[i] = mod-inv[mod%i] * (mod//i) % mod
                finv[i] = finv[i-1] * inv[i] % mod


def cmb_mod(n,k):
        if n<k : return 0
        return fac[n]*(finv[k]*finv[n-k]%mod)%mod

n=int(input())
a=list(map(int,input().split()))
ac = Counter(a)
sames=[i for i,x in enumerate(a) if x==ac.most_common()[0][0]]
same_len = sames[0]+(n-sames[1])
cmb_init()
print(n)

for i in range(1,n):
        print(cmb_mod(n+1,i+1) - cmb_mod(same_len,i))
print(1)

Fixed submission:
from collections import Counter
mod=10**9+7
N=10**5+11
fac,finv,inv = [0]*N,[0]*N,[0]*N
 
def cmb_init():
        fac[0]=fac[1]=finv[0]=finv[1]=inv[1]=1
        for i in range(2,N):
                fac[i] = fac[i-1]*i%mod
                inv[i] = mod-inv[mod%i] * (mod//i) % mod
                finv[i] = finv[i-1] * inv[i] % mod
 
 
def cmb_mod(n,k):
        if n<k : return 0
        return fac[n]*(finv[k]*finv[n-k]%mod)%mod
 
n=int(input())
a=list(map(int,input().split()))
ac = Counter(a).most_common()[0][0]
sames=[i for i,x in enumerate(a) if x==ac]
same_len = sames[0]+(n-sames[1])
cmb_init()
print(n)
 
for i in range(1,n):
        nums = cmb_mod(n+1,i+1) - cmb_mod(same_len,i)
        if nums < 0: nums+=mod
        print(nums)
print(1)
Buggy python submission (verdict: Runtime Error):
from math import sqrt
from math import log10
n=int(input())

i=1
ans=13
j=0

while i<sqrt(n):
    if n%i==0:
        j=n/i
        ans=int(min(ans,max(log10(i)+1,log10(j)+1)))
    i+=1
if j==0:
    ans=int(max(log10(i)+1,log10(j)+1))
print(ans)
    



Fixed submission:
from math import sqrt
from math import log10
n=int(input())

i=1
ans=13
j=0

while i<=sqrt(n):
    if n%i==0:
        j=n//i
        ans=int(min(ans,max(log10(i)+1,log10(j)+1)))
    i+=1
if j==0:
    ans=int(max(log10(i)+1,log10(j)+1))
print(ans)
Buggy python submission (verdict: Runtime Error):
from math import floor
from math import sqrt

def f(bb,nn):
    if(nn<bb): return nn
    else: return f(bb,floor(nn/bb))+(nn%bb)
        

n=int(input())
s=int(input())

if n==s:
    print(n+1)
    exit()
elif n<s:
    print(-1)
    exit()

for i in range(2,int(sqrt(n))):
    if s==f(i,n):
        print(i)
        exit()

ans=10**12
for i in range(1,int(sqrt(n))):
    tmpb=(n-s)/i+1
    if f(tmpb,n)==s: 
        tmpb=min(ans,tmpb)

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



Fixed submission:
from math import floor
from math import sqrt

def f(bb,nn):
    if(nn<bb): return nn
    else: return f(bb,floor(nn/bb))+(nn%bb)
        

n=int(input())
s=int(input())

if n==s:
    print(n+1)
    exit()
elif n<s:
    print(-1)
    exit()

for i in range(2,int(sqrt(n))+2):
    if s==f(i,n):
        print(i)
        exit()

for i in reversed(range(1,int(sqrt(n))+2)):
    if (n-s)%i == 0:
        tmpb=(n-s)//i+1
        if tmpb >= sqrt(n) and f(tmpb,n)==s: 
            print(tmpb)
            exit()
print(-1)
Buggy python submission (verdict: Runtime Error):
a = int(input())
if a-1000 >= 0:
  print "ABD"
else:
  print "ABC"

Fixed submission:
a = int(input())
if a-1000 >= 0:
  print("ABD")
else:
  print("ABC")
Buggy python submission (verdict: Runtime Error):
a,b = int(input().split())
a*=b
if a%2:
  print("Even")
else:
  print("Odd")

Fixed submission:
a,b = map(int,input().split())
a*=b
if a%2==0:
  print("Even")
else:
  print("Odd")
Buggy python submission (verdict: Runtime Error):
a,b=int(input().split())
if (a%3==0) || (b%3==0) || ((a+b)%3==0):
  print("Possible")
else:
  print("Impossible")

Fixed submission:
a,b=map(int,input().split())
if (a%3==0) or (b%3==0) or ((a+b)%3==0):
  print("Possible")
else:
  print("Impossible")
Buggy python submission (verdict: Runtime Error):
S,W=map(int,input().split())
if S　<=　W:
    print("unsafe")
else:
    print("safe")

Fixed submission:
S,W=map(int,input().split())
if S <= W:
    print("unsafe")
else:
    print("safe")

Buggy python submission (verdict: Runtime Error):
S,W=map(int,input().split())
if S=<W:
    print("unsafe")
else:
    print("safe")

Fixed submission:
S,W=map(int,input().split())
if S <= W:
    print("unsafe")
else:
    print("safe")
Buggy python submission (verdict: Runtime Error):
import math

R=input()
Z=R*2*math.pi
print(Z)

Fixed submission:
import math

r=float(input())
z=r*float(2)*math.pi

print(z)

Buggy python submission (verdict: Runtime Error):
import math
R=map(int,input())
Z=2*R*math.pi
print(Z)

Fixed submission:
import math

r=float(input())
z=r*float(2)*math.pi

print(z)
Buggy python submission (verdict: Runtime Error):
K = int(input())
A, B = map(int, input().split())

for i in range(A, B+1):
  if i % K == 0:
    print(OK)
  else:
    continue
if i = B:
  print(NG)

Fixed submission:
K = int(input())
A, B = map(int, input().split())
d = A // K
r = A % K

if r == 0:
  print("OK")
elif K*(d+1) >= A and K*(d+1) <= B:
  print("OK")
else:
  print("NG")
Buggy python submission (verdict: Runtime Error):
import collections
s = input()
l = len(s)

d = [0] * l
for i in range(l-1,0,-1):
  d[i] = int(s[i:]) % 2019

ans = 0
for v in collections.Counter(d).values():
  ans += v*(v-1)/2

print(int(ans))


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

if a > b:
  print('safe')
else:
  print('unsafe')
Buggy python submission (verdict: Time Limit Exceeded):
K = int(input())
def gcd(a, b):
    while b != 0:
        r = a%b
        a = b
        b = r
    return a
gcds = [gcd(gcd(a,b),c) for a in range(1, K+1) for b in range(1, K+1) for c in range(1, K+1)]
print(sum(gcds))

Fixed submission:
K = int(input())
def gcd(a, b):
    while b != 0:
        r = a%b
        a = b
        b = r
    return a
gcd_ab = [gcd(a,b) for a in range(1, K+1) for b in range(1, K+1)]
gcd_abc = [gcd(a_b,c) for a_b in gcd_ab for c in range(1, K+1)] 
print(sum(gcd_abc))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()
l=0

for k in range(N):
  for j in range(k):
    for i in range(j):
      if S[i] != S[j] and S[j] != S[k] and S[k] != S[i] and j-i != k-j:
        l += 1
      else:
        pass

print(l)

Fixed submission:
import re

N = int(input())
S = input()

R = re.findall("R", S)
G = re.findall("G", S)
B = re.findall("B", S)

c = 0
for i in range(N-2):
  for d in range((N-1-i)//2):
    if S[i] != S[i+d+1] and S[i+d+1] != S[i+2*d+2] and S[i+2*d+2] != S[i]:
      c += 1

print(len(R)*len(G)*len(B)-c)
Buggy python submission (verdict: Runtime Error):
money = int(input())
kane = 100
years = 0

while kane <= money:

    kane = kane * 1.01 
    math.floor(kane)
    years = years + 1
print(years)

Fixed submission:
# coding: utf-8

hage = int(input())
hoge = input().split()
 
hoge[0] = int(hoge[0])
hoge[1] = int(hoge[1])

renji = int(hoge[0]) - int(hoge[1])
 
e = hage
 
while e <= hoge[1]:
    if hoge[0] <= e and hoge[1] >= e:
        print("OK")
        break
    e = e + hage
if e > hoge[1] or e < hoge[0]:
    print("NG")

Buggy python submission (verdict: Runtime Error):
hage = input()
hoge = input()

renji = hoge[0] - hoge[1]

e = hage

while e <= hage[1];
  	if hoge[0] <= e and hage[1] >= e;
  		print("OK")
    	break
	e = e + hage
if e > hage[1] or e < hage[0];
	print("NG")
    
	

Fixed submission:
# coding: utf-8

hage = int(input())
hoge = input().split()
 
hoge[0] = int(hoge[0])
hoge[1] = int(hoge[1])

renji = int(hoge[0]) - int(hoge[1])
 
e = hage
 
while e <= hoge[1]:
    if hoge[0] <= e and hoge[1] >= e:
        print("OK")
        break
    e = e + hage
if e > hoge[1] or e < hoge[0]:
    print("NG")
Buggy python submission (verdict: Runtime Error):
a = input().split()
  2 b = a[0]
  3 c = a[1]
  4 if b == c:
  5     print("yes")
  6 else:
  7     print("no")

Fixed submission:
n = 0
m = 0
ac = input()
n = ac.split()[0]
m = ac.split()[1]

if n == m:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
if N = M
    print(yes)
else:
    print(no)


Fixed submission:
n = 0
m = 0
ac = input()
n = ac.split()[0]
m = ac.split()[1]

if n == m:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
i = int(input())
d = i * 800
b = i // 15

if 0 < b:
    c = d - (200 * b)
    print(c)
else:
    print(c)


Fixed submission:
i = int(input())
d = i * 800
b = i // 15

if 0 <= b:
    c = d - (200 * b)
    print(c)
else:
    print(c)
Buggy python submission (verdict: Runtime Error):
print(f"A{input().split()[1][0]}C")

Fixed submission:
print('A' + input().split()[1][0] + 'C')
Buggy python submission (verdict: Runtime Error):
a = input().split()
b = a
b = [int(x) for x in b]

a.remove(c)
if e == b:
    print("Yes")
else:
    print("No")

Fixed submission:
i = [int(s) for s in input().split()]
m = max(i)
i.remove(m)
a = i[0] + i[1]

if a == m:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
input1 = input()
kbai= int(input1)
 
input2=input().split(" ")
maxs= int(input2[0])
mins= int(input2[1])
flg=0
ans=0
 
while ans < maxs:
  ans=ans+kbai
  if ans >= mins and ans <= maxs:
    flg=1
 
if flg ==1:
  print("OK")
else:
  print("NG")


Fixed submission:
#
#at coder beginner contest165 1%
#
import math

input1 = input()
Ns = int(input1)

wallet=100
i=0

while wallet < Ns:
    wallet=math.floor(wallet*1.01)
    i=i+1

print(i)

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

wallet=100
i=0

while wallet < Ns:
	wallet=wallet*1.03
    i=i+1

print(i)

Fixed submission:
#
#at coder beginner contest165 1%
#
import math

input1 = input()
Ns = int(input1)

wallet=100
i=0

while wallet < Ns:
    wallet=math.floor(wallet*1.01)
    i=i+1

print(i)
Buggy python submission (verdict: Runtime Error):
if (A-B) > C:
  print (0)
else:
  print (A-B)

Fixed submission:
def main():
    A, B, C = [int(_) for _ in input().split()]
    if (A-B) < C:
      print (C-A+B)
    else:
      print(0)
main()
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
val=a+b+c
if val > 21:
    print("bust")
  else:
    print("win")
    
    



Fixed submission:
a,b,c=map(int,input().split())
val=a+b+c
if val > 21:
    print("bust")
else:
    print("win")

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

if sum>21:
    print("bust")
  
  else:
    print("win")


Fixed submission:
a,b,c=map(int,input().split())
val=a+b+c
if val > 21:
    print("bust")
else:
    print("win")

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

if sum>21:
  print("bust")
  
  else:
    print("win")

Fixed submission:
a,b,c=map(int,input().split())
val=a+b+c
if val > 21:
    print("bust")
else:
    print("win")

Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a+b+c==22;
    print("bust")
if a+b+c > 22;
    print("bust")
if a+b+c ==21;
    print("win")
  else:
    print("win")

Fixed submission:
a,b,c=map(int,input().split())
val=a+b+c
if val > 21:
    print("bust")
else:
    print("win")
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if 1<=a,b<=9:
    print(a*b)
    else:
    print(-1)

Fixed submission:
a,b=map(int,input().split())
if 1<=a<=9 and 1<=b<=9:
    print(a*b)
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
s=input()
t=input()
count=0
for i in range(3):
    if s(i)==t(i):
      count+=1
print(count)

Fixed submission:
s=input()
t=input()
count=0
for i in range(3):
    if s[i]==t[i]:
      count+=1
print(count)

Buggy python submission (verdict: Runtime Error):
s=input()
t=input()
count=0
for i in range(3):
    if s(i)==t(i):
      count+=1
print(count)


Fixed submission:
s=input()
t=input()
count=0
for i in range(3):
    if s[i]==t[i]:
      count+=1
print(count)

Buggy python submission (verdict: Runtime Error):
s=input()
t=input()
count=0
for i in range(3):
    if s(i)=t(i):
      count+=1
print(count)

Fixed submission:
s=input()
t=input()
count=0
for i in range(3):
    if s[i]==t[i]:
      count+=1
print(count)
Buggy python submission (verdict: Runtime Error):
a,s=map(int,input().split())
if a>=3200:
    print(s)
else:
    print("red")

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

if a >= 3200:
    print(s)
else:
    print("red")
Buggy python submission (verdict: Runtime Error):
s=input()
if s[1]==s[2] and s[3]==s[4]:
    print("yes")
    elif s[1]==s[3] and s[2]==s[4]:
        print("yes")
    elif s[1]==s[4] and s[2]==s[3]:
        print("yes") 
else:
    print("no")

Fixed submission:
s=input()
if s[0]==s[1] and s[2]==s[3] and s[0]!=s[2]:
  print("Yes")
elif s[0]==s[2] and s[1]==s[3] and s[0]!=s[1]:
  print("Yes")
elif s[0]==s[3] and s[1]==s[2] and s[0]!=s[1]:
  print("Yes")
else:
  print("No")