Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
A,B,N=map(int,input().split())
ans=0
if N<B:
    for i in range(1,N+1):
        if ((A*i)//B)-A*(i//B)>ans:
            ans=((A*i)//B)-A*(i//B)
else:
    if ((A*(B-1))//B)-A*((B-1)//B)>ans:
            ans=((A*(B-1))//B)-A*((B-1)//B)
print(ans)


Fixed submission:
A,B,N=map(int,input().split())
ans=0
if N<B:
    for i in range(N,N+1):
        if ((A*i)//B)-A*(i//B)>ans:
            ans=((A*i)//B)-A*(i//B)
else:
    if ((A*(B-1))//B)-A*((B-1)//B)>ans:
            ans=((A*(B-1))//B)-A*((B-1)//B)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
A,B,N=map(int,input().split())
ans=0
if N<B:
    for i in range(1,N+1):
        if ((A*i)//B)-A*(i//B)>ans:
            ans=((A*i)//B)-A*(i//B)
else:
    for i in range(1,B):
        if ((A*i)//B)-A*(i//B)>ans:
            ans=((A*i)//B)-A*(i//B)
print(ans)


Fixed submission:
A,B,N=map(int,input().split())
ans=0
if N<B:
    for i in range(N,N+1):
        if ((A*i)//B)-A*(i//B)>ans:
            ans=((A*i)//B)-A*(i//B)
else:
    if ((A*(B-1))//B)-A*((B-1)//B)>ans:
            ans=((A*(B-1))//B)-A*((B-1)//B)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
A,B,N=map(int,input().split())
ans=0
for i in range(1,N+1):
    if ((A*i)//B)-A*(i//B)>ans:
        ans=((A*i)//B)-A*(i//B)
print(ans)


Fixed submission:
A,B,N=map(int,input().split())
ans=0
if N<B:
    for i in range(N,N+1):
        if ((A*i)//B)-A*(i//B)>ans:
            ans=((A*i)//B)-A*(i//B)
else:
    if ((A*(B-1))//B)-A*((B-1)//B)>ans:
            ans=((A*(B-1))//B)-A*((B-1)//B)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))#N-1

for i in range(1,N+1):
    print(A.count(i))
    if i in A:
        A.remove(i)
    else:pass


Fixed submission:
N=int(input())
A=list(map(int,input().split()))#N-1
list=[]
for i in range(N):
    list.append(0)

for i in range(0,N-1):
    list[A[i]-1]+=1

for i in range(0,N):
    print(list[i])

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

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


Fixed submission:
N=int(input())
A=list(map(int,input().split()))#N-1
list=[]
for i in range(N):
    list.append(0)

for i in range(0,N-1):
    list[A[i]-1]+=1

for i in range(0,N):
    print(list[i])

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))#N-1
count=0
list=[]
for i in range(1,N):
    for j in range(0,N-1):
        if not j==N-2 and A[j]==i:
            count+=1
        elif j==N-2 and A[j]==i:
            count+=1
            list.append(count)
            count=0
        elif j==N-2 and not A[j]==i:
            list.append(count)
            count=0

if not len(list)==N:
    for i in range(0,N-len(list)):
        list.append(0)

for i in range(0,len(list)):
    print(list[i])


Fixed submission:
N=int(input())
A=list(map(int,input().split()))#N-1
list=[]
for i in range(N):
    list.append(0)

for i in range(0,N-1):
    list[A[i]-1]+=1

for i in range(0,N):
    print(list[i])
Buggy python submission (verdict: Runtime Error):
K=int(input())
A=[1,2,3,4,5,6,7,8,9]
B=[]
C=[]
D=[]
E=[]
F=[]
G=[]
H=[]
I=[]

def henkan(A):
    a=len(A)
    B=[]
    for i in range(a):
        if A[i]%10==0:
            B.append(10*A[i])
            B.append(10*A[i]+1)
        elif A[i]%10==9:
            B.append(10*A[i]+9)
            B.append(10*A[i]+8)
        else:
            x=A[i]%10
            B.append(10*A[i]+x)
            B.append(10*A[i]+x+1)
            B.append(10*A[i]+x-1)
    return B

B=henkan(A)
C=henkan(B)
D=henkan(C)
E=henkan(D)
F=henkan(E)
G=henkan(F)
H=henkan(G)
I=henkan(H)
ans=A+B+C+D+E+F+G+H+I
ans=sorted(ans)

print(ans[K-1])


Fixed submission:
K=int(input())
A=[1,2,3,4,5,6,7,8,9]
B=[]
C=[]
D=[]
E=[]
F=[]
G=[]
H=[]
I=[]
J=[]
def henkan(A):
    a=len(A)
    B=[]
    for i in range(a):
        if A[i]%10==0:
            B.append(10*A[i])
            B.append(10*A[i]+1)
        elif A[i]%10==9:
            B.append(10*A[i]+9)
            B.append(10*A[i]+8)
        else:
            x=A[i]%10
            B.append(10*A[i]+x)
            B.append(10*A[i]+x+1)
            B.append(10*A[i]+x-1)
    return B

B=henkan(A)
C=henkan(B)
D=henkan(C)
E=henkan(D)
F=henkan(E)
G=henkan(F)
H=henkan(G)
I=henkan(H)
J=henkan(I)
ans=A+B+C+D+E+F+G+H+I+J
ans=sorted(ans)

print(ans[K-1])

Buggy python submission (verdict: Runtime Error):
K=int(input())
A=[1,2,3,4,5,6,7,8,9]
B=[]
C=[]
D=[]
E=[]
F=[]
G=[]
H=[]
I=[]

def henkan(A):
    a=len(A)
    B=[]
    for i in range(a):
        if A[i]==0:
            B.append(10*A[i])
            B.append(10*A[i]+1)
        elif A[i]==9:
            B.append(10*A[i]+9)
            B.append(10*A[i]+8)
        else:
            x=A[i]%10
            B.append(10*A[i]+x)
            B.append(10*A[i]+x+1)
            B.append(10*A[i]+x-1)
    return B

B=henkan(A)
C=henkan(B)
D=henkan(C)
E=henkan(D)
F=henkan(E)
G=henkan(F)
H=henkan(G)
I=henkan(H)
ans=A+B+C+D+E+F+G+H+I
ans=sorted(ans)

print(ans[K-1])


Fixed submission:
K=int(input())
A=[1,2,3,4,5,6,7,8,9]
B=[]
C=[]
D=[]
E=[]
F=[]
G=[]
H=[]
I=[]
J=[]
def henkan(A):
    a=len(A)
    B=[]
    for i in range(a):
        if A[i]%10==0:
            B.append(10*A[i])
            B.append(10*A[i]+1)
        elif A[i]%10==9:
            B.append(10*A[i]+9)
            B.append(10*A[i]+8)
        else:
            x=A[i]%10
            B.append(10*A[i]+x)
            B.append(10*A[i]+x+1)
            B.append(10*A[i]+x-1)
    return B

B=henkan(A)
C=henkan(B)
D=henkan(C)
E=henkan(D)
F=henkan(E)
G=henkan(F)
H=henkan(G)
I=henkan(H)
J=henkan(I)
ans=A+B+C+D+E+F+G+H+I+J
ans=sorted(ans)

print(ans[K-1])
Buggy python submission (verdict: Runtime Error):
list=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
K=int(input())
print(list[K])


Fixed submission:
list=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
K=int(input())
print(list[K-1])
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
ans=0
mod=(10**9)+7
for i in range(len(A)-1):
    for j in range(i+1,len(A)):
        ans+=(a^b)
ans=ans%mod
print(ans)

Fixed submission:
x,y,z=map(int,input().split())
if x+y+z>=22:
    print("bust")
else:
    print("win")
Buggy python submission (verdict: Time Limit Exceeded):
A,B=map(int,input().split())
a=A
for i in range(1,B-A+1):
    b=a^(A+i)
    a=b
print(a)


Fixed submission:
A,B=map(int,input().split())
k=A%4
AA=A+4-k
l=B%4
BB=B-l
AAA=[]
BBB=[]
for i in range(A,AA):
    AAA+=[i]
for i in range(BB,B+1):
    BBB+=[i]

def henkan(A):
    if len(A)==4 or len(A)==0:
        return 0
    elif len(A)==3:
        return A[0]^A[1]^A[2]
    elif len(A)==2:
        return A[0]^A[1]
    elif len(A)==1:
        return A[0]
print(henkan(AAA)^henkan(BBB))
Buggy python submission (verdict: Runtime Error):
list=[chr(i) for i in range(97, 97+26)]
S=input()
A=[x for x in S]
A=set(A)
A=sorted(A)
for i in range(len(S)):
    if A[i] == list[i]:
        pass
    else:
        print(list[i])
        exit()
print("None")


Fixed submission:
list=[chr(i) for i in range(97, 97+26)]
S=input()
S=set(S)
A=[x for x in S]
A=sorted(A)
if len(A)<26:
    A+="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
for i in range(26):
    if A[i] == list[i]:
        pass
    else:
        print(list[i])
        exit()
print("None")
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=[int(x) for x in input().split()]

A=sorted(A)

if N%2==0:
    if all(A[i]==A[i+1] and A[0]==1 and A[i]+2==A[i+2] for i in range(0,N-2,2)):
        print(2**(N//2))
    else:
        print(0)
else:
    if all(A[0]==0 and A[i]==A[i+1] and A[i]-2==A[i-1] for i in range(2,N,2)):
        print(2**(N//2))
    else:
        print(0)


Fixed submission:
N=int(input())
A=[int(x) for x in input().split()]
mod=10**9+7
A=sorted(A)

if N%2==0:
    if all(A[i]==A[i+1] and A[0]==1 and A[1]==1 and A[i]-2==A[i-2] for i in range(2,N,2)):
        print((2**(N//2))%mod)
    else:
        print(0)
else:
    if all(A[0]==0 and A[i]==A[i-1] and A[i]-2==A[i-2] and A[-1]==N-1 for i in range(2,N,2)):
        print((2**(N//2))%mod)
    else:
        print(0)

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=[int(x) for x in input().split()]

A=sorted(A)

if N%2==0:
    if all(A[i]==A[i+1] and A[0]==1 and A[i]+2==A[i+2] for i in range(0,N-2,2)):
        print(2**(N//2))
    else:
        print(0)
else:
    if all(A[0]==0 and A[i+1]==A[i+2] and A[i+1]+2==A[i+3] for i in range(0,N-2,2)):
        print(2**(N//2))
    else:
        print(0)


Fixed submission:
N=int(input())
A=[int(x) for x in input().split()]
mod=10**9+7
A=sorted(A)

if N%2==0:
    if all(A[i]==A[i+1] and A[0]==1 and A[1]==1 and A[i]-2==A[i-2] for i in range(2,N,2)):
        print((2**(N//2))%mod)
    else:
        print(0)
else:
    if all(A[0]==0 and A[i]==A[i-1] and A[i]-2==A[i-2] and A[-1]==N-1 for i in range(2,N,2)):
        print((2**(N//2))%mod)
    else:
        print(0)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[int(x) for x in input().split()]

if N%2==1:
    if A.count(0)!=1:
        print(0)
        exit()
    elif A.count(0)==1:
        for i in range(1,N//2):
            if A.count(2*i)==2:
                pass
            else:
                print(0)
                exit()
else:
    for i in range(N//2):
        if A.count(2*i+1)==2:
            pass
        else:
            print(0)
            exit()

print(2**(N//2))    


Fixed submission:
N=int(input())
A=[int(x) for x in input().split()]
mod=10**9+7
A=sorted(A)

if N%2==0:
    if all(A[i]==A[i+1] and A[0]==1 and A[1]==1 and A[i]-2==A[i-2] for i in range(2,N,2)):
        print((2**(N//2))%mod)
    else:
        print(0)
else:
    if all(A[0]==0 and A[i]==A[i-1] and A[i]-2==A[i-2] and A[-1]==N-1 for i in range(2,N,2)):
        print((2**(N//2))%mod)
    else:
        print(0)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,x=map(int,input().split())
ans=0
ans=(b-a+1)//x

for i in range(a+ans*x,b+1):
    if i%x==0:
        ans+=1
        break
        
print(ans)


Fixed submission:
a,b,x=map(int,input().split())
ans=0
if (b-a+1)>=x:
    if a%x==0 and b%x==0:
        ans=((b-a)//x)+1
    elif not a%x==0 and not b%x==0:
        a=a+x-a%x
        b=b-b%x
        ans=((b-a)//x)+1
    elif not a%x==0 and b%x==0:
        a=a+x-a%x
        ans=((b-a)//x)+1
    elif a%x==0 and not b%x==0:
        b=b-b%x
        ans=((b-a)//x)+1
else:
    if a%x==0:
        ans=1
    else:
        if a+x-a%x<=b:
            ans=1
        else:
            ans=0
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
a,b,x=map(int,input().split())
ans=0
for i in range(a,b+1):
    if i%x==0:
        ans+=1
    else:
        pass
print(ans)


Fixed submission:
a,b,x=map(int,input().split())
ans=0
if (b-a+1)>=x:
    if a%x==0 and b%x==0:
        ans=((b-a)//x)+1
    elif not a%x==0 and not b%x==0:
        a=a+x-a%x
        b=b-b%x
        ans=((b-a)//x)+1
    elif not a%x==0 and b%x==0:
        a=a+x-a%x
        ans=((b-a)//x)+1
    elif a%x==0 and not b%x==0:
        b=b-b%x
        ans=((b-a)//x)+1
else:
    if a%x==0:
        ans=1
    else:
        if a+x-a%x<=b:
            ans=1
        else:
            ans=0
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a+b+c=17 and a*b*c=175:
    print(YES)
else:
    print(NO)


Fixed submission:
a,b,c=map(int,input().split())
if a+b+c==17 and a*b*c==175:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

# スペース区切りの整数の入力
a, b = map(int, raw_input().split())
list1=[]
d=b-a
for i in xrange(d+1):
    list1.append(a+i)
s=1
for i in list1:
    s=s*i
if s<0:
    print "Negative"
elif s==0:
    print "Zero"
else:
    print "Positive"

Fixed submission:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
a, b = map(int, raw_input().split())
dnum=b-a+1
if b<0:
    odd=0
    if dnum%2==1:
        odd=1
    if odd==0:
        print "Positive"
    else:
        print "Negative"
if a*b==0:
    print "Zero"
if b>0 and a<0:
    print "Zero"
if a>0:
    print "Positive"
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
sys.setrecursionlimit(10**7)
from pprint import pprint as pp
from pprint import pformat as pf
# @pysnooper.snoop()
#import pysnooper # debug

import math
#from sortedcontainers import SortedList, SortedDict, SortedSet # no in atcoder
import bisect


if __name__ == '__main__':
    n = int(input())
    data = list(map(int, input().split()))
    ans = 1
    for d in data:
        ans *= d
    if ans > 10 ** 18:
        print(-1)
    else:
        print(ans)

    #print('\33[32m' + 'end' + '\033[0m') # debug


Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
sys.setrecursionlimit(10**7)
from pprint import pprint as pp
from pprint import pformat as pf
# @pysnooper.snoop()
#import pysnooper # debug

import math
#from sortedcontainers import SortedList, SortedDict, SortedSet # no in atcoder
import bisect


def solve(data):
    ans = 1
    if 0 in data:
        return 0
    for d in data:
        ans *= d
        if ans > 10 ** 18:
            return -1
    return ans


if __name__ == '__main__':
    n = int(input())
    data = list(map(int, input().split()))
    ans = solve(data)
    #print('ans') # debug
    print(ans)

    #print('\33[32m' + 'end' + '\033[0m') # debug
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
sys.setrecursionlimit(10**7)
from pprint import pprint as pp
from pprint import pformat as pf

import math
#from sortedcontainers import SortedList, SortedDict, SortedSet # no in atcoder
import bisect


if __name__ == '__main__':
    any_haver = set()
    num_nusuke, num_treat_type = list(map(int, input().split()))
    d_for_loop = int(input())
    for i in range(d_for_loop):
        treat_haver = list(map(int, input().split()))
        for nusuke_id in treat_haver:
            any_haver.add(nusuke_id)
    # check
    count_not_have = 0
    for nusuke_id in range(1, num_nusuke + 1):
        #print('nusuke_id') # debug
        #print(nusuke_id) # debug
        if nusuke_id not in any_haver:
            count_not_have += 1
    #print('count_not_have') # debug
    #print(count_not_have) # debug
    print(count_not_have)



    #print('\33[32m' + 'end' + '\033[0m') # debug


Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
sys.setrecursionlimit(10**7)
from pprint import pprint as pp
from pprint import pformat as pf

import math
#from sortedcontainers import SortedList, SortedDict, SortedSet # no in atcoder
import bisect


if __name__ == '__main__':
    any_haver = set()
    num_nusuke, num_treat_type = list(map(int, input().split()))
    for i in range(num_treat_type):
        _ = int(input())
        treat_haver = list(map(int, input().split()))
        for nusuke_id in treat_haver:
            any_haver.add(nusuke_id)
    # check
    count_not_have = 0
    for nusuke_id in range(1, num_nusuke + 1):
        #print('nusuke_id') # debug
        #print(nusuke_id) # debug
        if nusuke_id not in any_haver:
            count_not_have += 1
    #print('count_not_have') # debug
    #print(count_not_have) # debug
    print(count_not_have)



    #print('\33[32m' + 'end' + '\033[0m') # debug
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
sys.setrecursionlimit(10**7)
from pprint import pprint as pp
from pprint import pformat as pf

import math
#from sortedcontainers import SortedList, SortedDict, SortedSet # no in atcoder
import bisect


if __name__ == '__main__':
    num_person = int(input())
    height_list = list(map(int, input().split()))
    height_list = [0] + height_list # var[0] is dummy
    count = 0
    for i in range(1, len(height_list)):
        h_i = height_list[i]
        #if h_i > num_person:
        #    continue
        for j in range(i + 1, len(height_list)):
            #print(i, j) # debug
            h_j = height_list[j]
            if j - i == h_j + h_i:
                count += 1
    #print('count') # debug
    #print(count) # debug
    print(count)

    #print('\33[32m' + 'end' + '\033[0m') # debug


Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
sys.setrecursionlimit(10**7)
from pprint import pprint as pp
from pprint import pformat as pf

import math
#from sortedcontainers import SortedList, SortedDict, SortedSet # no in atcoder
import bisect

class Counter(dict):

    def __init__(self, l=None):
        if l is None:
            return
        for e in l:
            self[e] += 1

    def __missing__(self, key):
        self[key] = 0
        return self[key]

def make_i_list(height_list):
    i_list = [0] * len(height_list) # [0] is dummy
    for i, h in enumerate(height_list):
        i_list[i] = h + i
    i_list.pop(0) # delete dummy
    return i_list

def make_j_list(height_list):
    j_list = [0] * len(height_list) # [0] is dummy
    for j, h in enumerate(height_list):
        j_list[j] = - h + j
    j_list.pop(0) # delete dummy
    return j_list

def make_same_ij_person_dict(i_list, j_list, same_ij_person_dict):
    for key in range(1, len(i_list)): # skip 0 because dummy
        if i_list[key] == j_list[key]:
            value = i_list[key]
            same_ij_person_dict[value] += 1


if __name__ == '__main__':
    num_person = int(input())
    height_list = [0] + list(map(int, input().split())) # [0] is dummy
    i_list = make_i_list(height_list)
    j_list = make_j_list(height_list)
    i_dict = Counter(i_list) # var[value] = count
    j_dict = Counter(j_list) # var[value] = count
    # there is no person that i_list[key] == j_list[key]
    #print('i_list') # debug
    #print(i_list) # debug
    #print(i_dict) # debug
    #print('j_list') # debug
    #print(j_list) # debug
    #print(j_dict) # debug
    ans_count = 0
    for value in i_dict.keys():
        if value in j_dict.keys():
            ans_count += i_dict[value] * j_dict[value]
    print(ans_count)


    #print('\33[32m' + 'end' + '\033[0m') # debug
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import pysnooper # @pysnooper.snoop()
from pprint import pprint as pp
from pprint import pformat as pf

def solve():
    k = int(input())
    a, b = map(int, input().split())
    v = k
    while not (v > b):
        if a <= v <= b:
            print("OK")
            return 0
        v += k
    print("NG")
    return 0


if __name__ == '__main__':
    solve()


Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from pprint import pprint as pp
from pprint import pformat as pf

def solve():
    k = int(input())
    a, b = map(int, input().split())
    v = k
    while not (v > b):
        if a <= v <= b:
            print("OK")
            return 0
        v += k
    print("NG")
    return 0


if __name__ == '__main__':
    solve()

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import pysnooper # @pysnooper.snoop()
from pprint import pprint as pp
from pprint import pformat as pf

def solve():
    k = int(input())
    a, b = map(int, input().split())
    v = k
    while not (v > b):
        if a <= v <= b:
            print("OK")
            return 0
        v += k
    print("NG")
    return 0


if __name__ == '__main__':
    solve()

    print('\33[32m' + 'end' + '\033[0m')


Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from pprint import pprint as pp
from pprint import pformat as pf

def solve():
    k = int(input())
    a, b = map(int, input().split())
    v = k
    while not (v > b):
        if a <= v <= b:
            print("OK")
            return 0
        v += k
    print("NG")
    return 0


if __name__ == '__main__':
    solve()

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import pysnooper # @pysnooper.snoop()
from pprint import pprint as pp
from pprint import pformat as pf

def solve():
    k = int(input())
    a, b = map(int, input().split())
    v = k
    while not (v > b):
        if a <= v <= b:
            print("OK")
            return 0
        v += k
    print("NG")
    return 0


if __name__ == '__main__':
    solve()

    print('\33[32m' + 'end' + '\033[0m')


Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from pprint import pprint as pp
from pprint import pformat as pf

def solve():
    k = int(input())
    a, b = map(int, input().split())
    v = k
    while not (v > b):
        if a <= v <= b:
            print("OK")
            return 0
        v += k
    print("NG")
    return 0


if __name__ == '__main__':
    solve()
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import pysnooper # @pysnooper.snoop()
from pprint import pprint as pp
from pprint import pformat as pf

import math


if __name__ == '__main__':
    x = int(input())
    money = 100
    count = 0
    while not (money >= x):
        money = math.floor(money * 101 / 100)
        count += 1
    print(count)


Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from pprint import pprint as pp
from pprint import pformat as pf

import math


if __name__ == '__main__':
    x = int(input())
    money = 100
    count = 0
    while not (money >= x):
        money = math.floor(money * 101 / 100)
        count += 1
    print(count)
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from pprint import pprint as pp
from pprint import pformat as pf

import math

def calc(a, b, x):
    return math.floor(a * x / b) - a * math.floor(x / b)

if __name__ == '__main__':
    a, b, n = map(int, input().split())
    if b > n:
        x = n
        m = calc(a, b, x)
    else:
        m = 0
        k = 1
        while b * k <= n:
            v = calc(a, b, b * k - 1)
            m = max(m, v)
            k += 1
    print(m)


Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from pprint import pprint as pp
from pprint import pformat as pf

import math

def calc(a, b, x):
    return math.floor(a * x / b) - a * math.floor(x / b)

if __name__ == '__main__':
    a, b, n = map(int, input().split())
    if b > n:
        m = calc(a, b, n)
    else:
        m = calc(a, b, b - 1)
    print(m)

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from pprint import pprint as pp
from pprint import pformat as pf

import math


if __name__ == '__main__':
    a, b, n = map(int, input().split())
    if b > n:
        return print(n)
    else:
        return print(b - 1)


Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from pprint import pprint as pp
from pprint import pformat as pf

import math

def calc(a, b, x):
    return math.floor(a * x / b) - a * math.floor(x / b)

if __name__ == '__main__':
    a, b, n = map(int, input().split())
    if b > n:
        m = calc(a, b, n)
    else:
        m = calc(a, b, b - 1)
    print(m)

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from pprint import pprint as pp
from pprint import pformat as pf

import math


if __name__ == '__main__':
    a, b, n = map(int, input().split())

    m = 0
    for x in range(n + 1):
        k = ((a * x) // b) - a * (x // b)
        #print('x, k, m', x, k, m) # debug
        m = max(m, k)
    print(m) # debug



Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from pprint import pprint as pp
from pprint import pformat as pf

import math

def calc(a, b, x):
    return math.floor(a * x / b) - a * math.floor(x / b)

if __name__ == '__main__':
    a, b, n = map(int, input().split())
    if b > n:
        m = calc(a, b, n)
    else:
        m = calc(a, b, b - 1)
    print(m)