Problem:


Score: 100 points

Problem Statement

Takahashi the Jumbo will practice golf.

His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive).

If he can achieve the objective, print OK; if he cannot, print NG.

Constraints

All values in input are integers.

1 \leq A \leq B \leq 1000

1 \leq K \leq 1000

Input

Input is given from Standard Input in the following format:

K
A B

Output

If he can achieve the objective, print OK; if he cannot, print NG.

Sample Input 1

7
500 600

Sample Output 1

OK

Among the multiples of 7, for example, 567 lies between 500 and 600.

Sample Input 2

4
5 7

Sample Output 2

NG

No multiple of 4 lies between 5 and 7.

Sample Input 3

1
11 11

Sample Output 3

OK



Sample input:
7
500 600


Sample output:
OK

Submission status: Runtime Error

Solution code:
K=int(input())
A,B=map(int,input().split())
a=0
if i in range(A,B+1):
  if i%k==0:
    a+=1
if a==1:
  print("OK")
else:
  print("NG")

Submission status: Runtime Error

Solution code:
K=int(input())
A,B=map(int,input().split())
a=0
if i in range(A,B+1):
  if k%i==0:
    a+=1
if a==1:
  print("OK")
else:
  print("NG")

Submission status: Runtime Error

Solution code:
a=int(input())
b,c=map(int,input().split())

flag=False
for i in range(a,b+1):
   if i%a==0:
   flag=True
   break
print("OK" if flag else "NG")

Submission status: Runtime Error

Solution code:
import sys
from numba import njit
input = sys.stdin.buffer.readline


@njit
def main():
    K = int(input())
    A, B = map(int, input().split())
    for i in range(A, B + 1):
        if i % K == 0:
            print('OK')
            return 0
    print('NG')
    return 0


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.buffer.readline
 
 
def main():
    K = int(input())
    A, B = map(int, input().split())
	for i in range(A, B + 1):
        if i % K == 0:
            print('OK')
            sys.exit()
    print('NG')
 
 
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.buffer.readline


def main():
  	K = int(input())
	A, B = map(int, input().split())
    for i in range(A, B + 1):
        if i % K == 0:
            print('OK')
            sys.exit()
    print('NG')


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
K = int(input())
k = K
A,B = map(int, input().split())
for i in range(1, B+1):
    k *= i
    if k > A and k < B:
        print('OK')
        a = True
        break
    else:
        k = K
        continue
if a != True:
    print('NG')

Submission status: Runtime Error

Solution code:
K = int(input())
k = K
A,B = map(int, input().split())
for i in range(1, B+1):
    k *= i
    if k > a and k < b:
        print('OK')
        a = True
        break
if not a:
    print('NG')

Submission status: Runtime Error

Solution code:
K=int(input())
A=int(input())
B=int(input())

if ('A,B%K==0'):
  print('OK')
else:
  print('NG')

Submission status: Runtime Error

Solution code:
K=int(input())
A=int(input())
B=int(input())
if A>=1 and B<=1000:
  print('OK')
else:
  print('NG')

Submission status: Runtime Error

Solution code:
 main():
    K = int(input())
    A, B = map(int, input().split())
    x = list(range(K, 1001, K))
    print('OK') if any([A <= i <= B for i in x]) else print('NG')

    return


if __name__=="__main__":
    main()

Submission status: Runtime Error

Solution code:
A,B,N = map(int,input().split())
ans = []
if N < 15:
    for x in range(N+1):
        tmp = (A * x // B) - A * (x//B)
        ans.append(tmp)
        #print(tmp)
else:
    for x in range(N-1000,N+1):
        tmp = (A * x // B) - A * (x//B)
        ans.append(tmp)
        #print(tmp)
print(max(ans))

Submission status: Runtime Error

Solution code:
k=int(input())
a,b=map(int,input().split())
for i in range(a,b+1):
  if i%k==0:
    print 'OK'
  
  else:
    print 'NG'

Submission status: Runtime Error

Solution code:
k = int(input())
a,b = map(int, input().split))

aa = a % k
bb = b % k

if(b - a > k):
    print('OK')
if(aa > bb):
    print('OK')
if(aa == 0):
    print('OK')
else:
    print('NG')

Submission status: Runtime Error

Solution code:
k = int(input())
a,b = map(int, input().split)

aa = a % k
bb = b % k

if(b - a > k):
    print('OK')
if(aa > bb):
    print('OK')
if(aa == 0):
    print('OK')
else:
    print('NG')

Submission status: Runtime Error

Solution code:
K=int(input())

ARGS=input().split()
A=int(ARGS[0])
B=int(ARGS[1])

largest=B / K * K
if A <= largest
    print('OK')
else:
    print('NG')

Submission status: Runtime Error

Solution code:
K=int(input())

ARGS=input().split()
A=int(ARGS[0])
B=int(ARGS[1])

largest=b / k * k
if A <= largest
    print('OK')
else:
    print('NG')

Submission status: Runtime Error

Solution code:
k = int(input())
a, b = map(int, input())

answer = 'NG'

for i in range(a,b):
    if i % k == 0:
        answer = 'OK'
print(answer)

Submission status: Runtime Error

Solution code:
k = int(input())
a = int(input())
b = int(input())

for i in range(a,b+1):
  if i % k == 0:
    print("OK")
    break
else :
  print("NG")

Submission status: Runtime Error

Solution code:
k=int(input())
a,b=map(int,input.split())
list=range(a,b+1)
for val in list:
  if val%k==0:
    print('OK')
    break
  else:
    print('NG')
    continue

Submission status: Runtime Error

Solution code:
nmq=list(map(int, input().split()))
N=nmq[0]
M=nmq[1]
Q=nmq[2]
ablist=[list(map(int, input().split())) for i in range(Q)]
sumlist=[]
alist=[i for i in range(1,M+1)]
import itertools as ite
case=list(ite.combinations_with_replacement(alist,N))
for nowcase in case:
    sumd=0
    for i in range(Q):
        a=ablist[i][0]
        b=ablist[i][1]
        c=ablist[i][2]
        d=ablist[i][3]
        aa=nowcase[a-1]
        ab=nowcase[b-1]
        if ab-aa==c:
            sumd+=d
    sumlist.append(sumd)
print(max(sumlist))

Submission status: Runtime Error

Solution code:
nmq=list(map(int, input().split()))
N=nmq[0]
M=nmq[1]
Q=nmq[2]
ablist=[list(map(int, input().split())) for i in range(Q)]
sumlist=[]
alist=[i for i in range(1,M+1)]
import itertools as ite
case=list(ite.combinations_with_replacement(alist,N))
for nowcase in case:
    sumd=0
    for i in range(Q):
        a=ablist[i][0]
        b=ablist[i][1]
        c=ablist[i][2]
        d=ablist[i][3]
        aa=nowcase[a-1]
        ab=nowcase[b-1]
        if ab-aa==c:
            sumd+=d
    sumlist.append(sumd)
sumlist.sort(reverse=True)
print(sumlist[0])

Submission status: Runtime Error

Solution code:
nmq=list(map(int, input().split()))
N=nmq[0]
M=nmq[1]
Q=nmq[2]
ablist=[list(map(int, input().split())) for i in range(Q)]
sumlist=[]
alist=[]
for i in range(1,M+1):
    alist.append(i)
import itertools as ite
case=list(ite.combinations_with_replacement(alist,N))
for nowcase in case:
    sumd=0
    for i in range(Q):
        a=ablist[i][0]
        b=ablist[i][1]
        c=ablist[i][2]
        d=ablist[i][3]
        aa=nowcase[a-1]
        ab=nowcase[b-1]
        if ab-aa==c:
            sumd+=d
    sumlist.append(sumd)
sumlist.sort(reverse=True)
print(sumlist[0])

Submission status: Runtime Error

Solution code:
k=int(input())
a,b=map(int,input().split())
for i in range(a,b+1):
  if i%k==0:
    print("OK")
    break
else:
  print("NG")
  break

Submission status: Runtime Error

Solution code:
import random
k = int(input())
a, b = map(int, input().split())
c = random.randrange(a, b)
if c % k == 0:
  print('OK')
else:
  print('NG')

Submission status: Runtime Error

Solution code:
k = int(input())
a,b = map(int, input())
print('OK') if b-a+1 >= k else print('NG')

Submission status: Runtime Error

Solution code:
# Python 3
import sys
import itertools
import numpy as np
 
read = sys.stdin.buffer.read #標準入力から複数行取得するための関数です。 readlines() が結果を行単位で分割してリストで返すのに対して、 read() は結果をそのまま1つの文字列として取得します。
readline = sys.stdin.buffer.readline #標準入力から1行取得するための関数です。
readlines = sys.stdin.buffer.readlines #標準入力から複数行取得するための関数です。戻り値はリストで、入力された文字列が1行ずつ要素として格納されています。

N, M, Q = map(int, readline().split())
 
A = np.array(list(itertools.combinations_with_replacement(range(1, M + 1), N)))
# [[1 1 1]
#  [1 1 2]
#  [1 1 3]
#  [1 1 4]
#  [1 2 2] ...
# NumPy配列

n = len(A)
score = np.zeros(n, np.int32)
m = map(int, read().split())
for a, b, c, d in zip(m, m, m, m):
    cond = A[:, b - 1] - A[:, a - 1] == c # NumPy配列
    score += d * cond

print(score.max())

Submission status: Runtime Error

Solution code:
K=int(input())
A,B=map(int,input().split())

for i in range(A,B,1):
    if (i %= K) == 0:
        print("OK")
        break
print("NG")

Submission status: Runtime Error

Solution code:
K=input()
A=input()
B=input()

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

Submission status: Runtime Error

Solution code:
K=input()
A=input()
B=input()

for i in range(A,B,1):
  if (i %= K) == 0:
    print("OK")

Submission status: Runtime Error

Solution code:
K=input()
A=input()
B=input()

for i in range(A,B):
  if (i %= K) ==0:
    print("OK")

Submission status: Runtime Error

Solution code:
K=input()
A=input()
B=input()

i %= K
for i in range(A,B): 
  if i==0:
    print("OK")

Submission status: Runtime Error

Solution code:
K=input()
A=input()
B=input()

for i in range(A,B):
  i %= K
  if i==0:
    print("OK")

Submission status: Runtime Error

Solution code:
K=input()
A=input()
B=input()

for i in range(A,B)
i %= K
if i==0:
  print("OK")

Submission status: Runtime Error

Solution code:
K = input()
A, B = [int(a) for a in input().split()]
p = A // K + K
if A < p and B < p:
    print("OK")
else:
    print("NG")

Submission status: Runtime Error

Solution code:
K=int(K)
A=int(A)
B=int(B)
if A<=(B//K)*K:
  print("OK")
else:
  print("NG")

Submission status: Runtime Error

Solution code:
K=input("K=")
A=input("A=")
B=input("B=")
K=int(K)
A=int(A)
B=int(B)
1<=A<=B<=1000
1<=K<=1000
if A<=(B//K)*K:
  print("OK")
else:
  print("NG")

Submission status: Runtime Error

Solution code:
K=input("K=")
A=input("A=")
B=input("B=")
K=int(K)
A=int(A)
B=int(B)
1<=A<=B<=1000
1<=K<=1000
if A<=B//K*K:
  print("OK")
else:
  print("NG")

Submission status: Runtime Error

Solution code:
K=input("K=")
A=input("A=")
B=input("B=")
K=int(K)
A=int(A)
B=int(B)
1=<A=<B=<1000
1=<K=<1000
if A=<B//K*K:
  print("OK")
else:
  print("NG")

Submission status: Runtime Error

Solution code:
K = int(input())

A, B = map(int, input())

if A // K <= B // K and B % K == 0:
    print("OK")
else:
    print("NG")

Submission status: Runtime Error

Solution code:
import sys

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

for i in range(A, B + 1):
  if i % K == 0:
    print('OK')
    sys.exit()
	
print('NG')

Submission status: Runtime Error

Solution code:
K = input()
A, B = map(int, input().split())

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

Submission status: Runtime Error

Solution code:
k = int(input())
a, b = map(int,input().split())

for x in range(a, b+1):
    if x%k == 0:
        print("OK")
        exit(1)

print("NG")

Submission status: Runtime Error

Solution code:
nt(input())
A , B = map(int,input().split())

if A == B:
    if A % K == 0:
        print('OK')
    else:
        print('NG')

else:
    for i in range(B-A):
        i += A
        if i % K == 0:
            print('OK')
            break

    else:
        print('NG')

Submission status: Runtime Error

Solution code:
K = int(input())
A, B = list(map(int, input().split()))

for i in range(A, B+1):
  if i％K == 0:
    print("OK")
    end
print("NG")

Submission status: Runtime Error

Solution code:
n = int(input())
s,d = map(int,input().split())

c = 0
for i in range(s,d+1):
  if i % s == 0:
  	c = c + 1


if c != 0:
 	print("OK"
else:
  	print("NG")

Submission status: Runtime Error

Solution code:
n = int(input())
s,d = map(int,input().split())

c = 0
for i in range(s,d+1:
  if i % s == 0:
  	c = c + 1


if c != 0:
 	print("YES")
else:
  	print("NO")

Submission status: Runtime Error

Solution code:
k = int(input('k: '))
a, b = int(input('a: ')), int(input('b: '))

res = False

for i in range(a, b + 1):
    if i % k == 0:
        res = True
        break

if res == True:
    print('OK')
else:
    print('NG')

Submission status: Runtime Error

Solution code:
k = int(input('k = '))
a = int(input('a = ')); b = int(input('b = '))

res = False

for i in range(a, b + 1):
    if i % k == 0:
        res = True
        break

if res == True:
    print('OK')
else:
    print('NG')

Submission status: Runtime Error

Solution code:
K = int(input())
A, B = (int(x) for x in input().split())

if (K / (B // K))- (K / (A // K)) >= 0:
    print("OK")
else:
    print("NG")

Submission status: Runtime Error

Solution code:
k = int(input())
a, b = map(int, input().split())
for i in range(a, b+1):
  if(i%k == 0):
    print("OK")
    exsi()
print("NG")

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
root = int(input())
ranges = list(map(int, input().slice()))
flag = False

for i in range(ranges[0], ranges[1] + 1):
    if i % root:
        flag = True
        
if flag: 
    print('OK')
else:
    print('NG')

Submission status: Runtime Error

Solution code:
# k=(int)(input())
import math
a,b,n=map(int,input().split())
if(n<=b):
    print(math.floor((a*n)/b))
else:
    print(math.floor((a*b-1)/b))

Submission status: Runtime Error

Solution code:
import bisect
import sys


N = int(input())
a = list(map(int, input().split()))
to = [[] for _ in range(N)]
for _ in range(N - 1):
    u, v = map(int, input().split())
    u -= 1
    v -= 1
    to[u].append(v)
    to[v].append(u)
del u, v

ans = [-1] * N


def dfs(v, dp):
    # dp は参照渡し
    if len(dp) == 0 or a[v] > dp[-1]:
        dp.append(a[v])
        back = -1
    else:
        pos = bisect.bisect_left(dp, a[v])
        back = dp[pos]
        dp[pos] = a[v]
    ans[v] = len(dp)

    for u in to[v]:
        if ans[u] == -1:
            dfs(u, dp)
    if back == -1:
        dp.pop()
    else:
        dp[pos] = back


sys.setrecursionlimit(10 ** 6)
dfs(0, [])


for an in ans:
    print(an)

Submission status: Runtime Error

Solution code:
K=int(input())
[A,B]=list(map(int(),input().split()))
flg=0
for n in range(A,B+1):
  if n%K==0:
    print("OK")
    flg==1
    break
if flg==0:print("N_G")

Submission status: Runtime Error

Solution code:
K=int(input())
[A,B]=list(map(int(),input().split()))
flg=0
for n in range(A,B+1):
  if n%K==0:
    print("OK")
    flg==1
    break
if flg==0:print("NG")

Submission status: Runtime Error

Solution code:
money = int(input())
kane = 100
years = 0

while kane <= money:

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

Submission status: Runtime Error

Solution code:
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")

Submission status: Runtime Error

Solution code:
L=list(map(int,input().split()))
A=L[0]
B=L[1]
N=L[2]
if N>=B-1:
    print(int(A*(B-1)/B))
else:
    print(int(A*N/B))

Submission status: Runtime Error

Solution code:
k=int(input())
a,b=map(int,input.split())
if b-a>k:
    print('OK')
else:
    print('NG')

Submission status: Runtime Error

Solution code:
K=int(input())
A,B=map(int,input().split())
flag=0    
for i in range(A,B,1):
    if i % K ==0:
       a=1 
        
if a==0:
   print("NG")
    
    
else:
  print("OK")

Submission status: Runtime Error

Solution code:
K=int(input())
A,B=map(int,input().split())
a=0    
for i in range(A,B,1):
    if i % K ==0:
       print("OK")
       a+=1
       break 
        
elif a==0:
   print("NG")

Submission status: Runtime Error

Solution code:
K=int(input())
A,B=map(int,input().split())
a=0    
for i in range(A,B,1):
    if i % K ==0:
       print("OK")
        a+=1
       break 
        
if a==0:
   print("NG")

Submission status: Runtime Error

Solution code:
K=int(input())
A,B=map(int,input().split())
a=0    
for i in range(A,B,1):
    if i % K ==0:
       print("OK")
        a+=1
       break 
        
elif a==0:
   print("NG")

Submission status: Runtime Error

Solution code:
K=int(input())
A,B=map(int,input().split())
flag=False
a=0
while flag:
    
    for i in range(A,B,1):
        if i % K ==0:
            print("OK")
            a+=1
            flag=True
            break
        else:    

    if flag:
        break
        
if a==0:
  print("NG")

Submission status: Runtime Error

Solution code:
A,B,N = map(int,input().split())
x = min(N, B-1)
a = A*x//B - A*(x//B)
print(a)

Submission status: Runtime Error

Solution code:
A,B,N = map(int,input().split())
x = 0
a = 0
while x <= B-1:
  if x%B != 0 and a < A*x//B - A*(x//B):
    a = A*x//B - A*(x//B)
    x -= 1
  else:
    x -= 1
print(a)

Submission status: Runtime Error

Solution code:
A,B,N = map(int,input().split())
x = N
a = 0
while x>999*N//1000:
  if x%B != 0 and a < A*x//B - A*(x//B):
    a = A*x//B - A*(x//B)
    x -= 1
  else:
    x -= 1
print(a)

Submission status: Runtime Error

Solution code:
K = input()
A = input()
B = input()

i = 1
r = i * K
while r <= B:
  if r >= A:
    print('YES')
  elif r < A:
    i += 1
    r =  i * K
  else:
    print('NO')

Submission status: Runtime Error

Solution code:
K = int(input())
A, B = input().split()

if B - A >= K-1:
    print("OK")
else:
    print("NG")

Submission status: Runtime Error

Solution code:
K = int(input())
A, B = int(input().split())

if B - A >= K-1:
    print("OK")
else:
    print("NG")

Submission status: Runtime Error

Solution code:
k = int(input())
data = input.split()
a = data[0]
b = data[1]

if a - b > k:
  print("OK")
else:
  ans = False
  for i in range(a, b + 1):
    if i % k == 0:
      ans = True
  print("OK" if ans else "NG")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from math import floor
A,B,N = map(int,input().split())
if(B-1>N):
    Nomin = floor(N)
else:
    Nomin = floor(B-1)

print(Nomin)

Submission status: Runtime Error

Solution code:
K = int(input())
A = int(input())
B = int(input())
if B-A > K:
    print('OK')
else:
    print('NG')

Submission status: Runtime Error

Solution code:
n=int(input())
a,b=map(int,input().split())

for i in range(a,b+1):
    if i%n==0:
        flag=1
if flag==1:
    print("OK")
else:
    print("NG")

Submission status: Runtime Error

Solution code:
K = int(input())
A,B = map(int,input().split())

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

Submission status: Runtime Error

Solution code:
a1 = int(input())
a2,a3 = int(input()).split()
if int (a2/a1) ==int(a3/a1):
    print("NG")
else:
    print("OK")

Submission status: Runtime Error

Solution code:
a1 = int(input())
a2,a3 = int(input()),int(input())
if int (a2/a1) ==int(a3/a1):
    print("NG")
else:
    print("OK")

Submission status: Runtime Error

Solution code:
a1 = int(input())
a2,a3 = int(input()),int(input())
if int (a2/a1) ==int(a3/a1):
    print("NG")
else:
    print("ok")

Submission status: Runtime Error

Solution code:
a1 = int(input())
a2,a3 = int(input()),int(input())
if int (a2/a1) =int(a3/a1):
    print("NG")
else:
    print("ok")

Submission status: Runtime Error

Solution code:
a1 = input()
a2,a3 = input(),input()
if a2< a1<a3:
    print("ok")
else:
    print("NG")

Submission status: Runtime Error

Solution code:
K = int(input())
A, B = map(int, input().split())

if ((A // K != B // K) || A % K == 0 || B % K == 0):
	print('OK')
else:
	print('NG')

Submission status: Runtime Error

Solution code:
k = int(input())
a,b = map(int,input().split())
for i in range(a,b+1):
	if i%k == 0:
    	print('OK')
        exit()
print('NG')

Submission status: Runtime Error

Solution code:
K = int(input())
A, B = map(int, input().split())

s = (B // K) * K
if s => A: #もし最大のKの倍数がA以上ならOK
    print("OK")
else:
    print("NG")

Submission status: Runtime Error

Solution code:
K = int(input())
A, B = map(int, input().split())

s = (B // K) * K
if B => A: #もし最大のKの倍数がA以上ならOK
    print("OK")
else:
    print("NG")

Submission status: Runtime Error

Solution code:
K=input()
a,b=map(int,input().split())
p=1
for i in range(a,b+1):
  if i%K==0:
    print("OK")
    p=0
    break
if p==1:
  print("NG")

Submission status: Runtime Error

Solution code:
K=input()
a,b=map(int,inport().split())
p=1
for i in range(a,b+1):
  if i%K==0:
    print("OK")
    p=0
    break
if p==1:
  print("NG")

Submission status: Runtime Error

Solution code:
import math

K = input()
distance = list(map(int,input().split()))

for i in range(distance[1]-distance[0]+1):
    if (distance[0]+i) % K == 0:
        print("OK")

print("NG")

Submission status: Runtime Error

Solution code:
import math

K = input()
distance = list(map(int,input().split()))

for i in range(len(distance)):
    if distance[i] % K == 0:
        print("OK")

print("NG")

Submission status: Runtime Error

Solution code:
k= int(input())
s= input().rsprit().split()
a = int(s[0])
b = int(s[1])
f = "NG"
for i in range(a,b):
  if i%k == 0:
    f = "OK"
print(f)

Submission status: Runtime Error

Solution code:
入力
入力は以下の形式で標準入力から与えられる。
K
AB
出力
目標の達成が可能であれば OK と、不可能であれば NG と出力せよ。
k= int(input())
s= input().rsprit().split()
a = int(s[0])
b = int(s[1])
f = "NG"
for i in range(a,b):
	if i%k == 0:
  		f = "OK"
print(f)

Submission status: Runtime Error

Solution code:
K = int(input())
A,B = map(int,input().split())

for i in range(A, min(A+K,B)):
  if math.floor(B / K == 0):
    print("OK")
else
  print("NG")

Submission status: Runtime Error

Solution code:
K=int(input())
A,B=map(int,input().split())
 
for i in range(A,B+1):
  if(i>=K and i%K==0):
    print("OK")
  	exit()
print("NG")

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
from itertools import itertools_with_replacement
N,M,Q=map(int,input().split())
abcd=[]
for _ in range(Q):
    abcd.append(tuple(map(int,input().split())))
Abase=[]
for a in range(1,M+1):
    Abase=Abase+[a]
A=set(itertools.combinations_with_replacement(Abase,N))
ans=0
for i in A:
    temp=0
    for j in abcd:
        if i[j[1]-1]-i[j[0]-1]==j[2]:
            temp=temp+j[3]
    if temp>=ans:
        ans=temp
print(ans)

Submission status: Runtime Error

Solution code:
K = int(input())
A,B = map(int,input().split())

if K - A % K <= B-A:
    print("OK")
elif k == 1:
    print("OK")
else:
    print("NG")

Submission status: Runtime Error

Solution code:
K = int(input())
A, B = map(int, input().split())
 
l = 0
ret = 'NG'
while l <= B:
  if l >= A:
    result = 'OK'
  l+=K
  
  
print(result)

Submission status: Runtime Error

Solution code:
K = int(input())
A, B = map(int, input().split())

l = 0
ret = 'NG"
while l <= B:
  if l >= A:
    ret = 'OK'
  l += K
  
print(ret)

Submission status: Runtime Error

Solution code:
A = 1
B = 100
K = int(input())
Jumbo = int(input())
A <= Jumbo <=B
print("OK" if Jumbo % K == 0 else "NG")

Submission status: Runtime Error

Solution code:
a, b, n = map(int, input().split(" "))

max_score = 0
y = b // a

for x in range(max(y - 1000000, 1) , min(y + 2000000, n+1)):
    score = a * x // b - a * ( x // b )
    if score > max_score:
        max_score = score
print(max_score)

Submission status: Runtime Error

Solution code:
import math
 
a = list(map(int, input().split()))
A = a[0]
B = a[1]
N = a[2]
 
if N%B !=0:
  x_1 = (N//B)*B-1
  if x_1 == -1:
    x_1 = N
  x_2 = N
elif N == 1 or B ==1:
  x_1 =N
  x_2 =N

else:
  x_1 = N-1
  x_2 = N-1
ans_1 = math.floor(A*x_1/B)-A*math.floor(x_1/B)
ans_2 = math.floor(A*x_2/B)-A*math.floor(x_2/B)
if ans_1 >= ans_2:
  print(ans_1)
else:
  print(ans_2)

Submission status: Runtime Error

Solution code:
K = int(input())

A = int(input())

B = int(input())

for n in range(0, 1000, 1):
  if A <= K*n <= B:
    print("OK")
else:
  print("NG")

Submission status: Runtime Error

Solution code:
K = int(input())

A = int(input())

B = int(input())

for n in range(0, 1000, 1):
  if A <= K*n <= B:
    print("OK"):
      break
else:
  print("NG")

Submission status: Runtime Error

Solution code:
K=int(input())
A,B=int(input().split())
check=False
for i in range(0,B-A):
  if (B-A-i)%K==0:
    check=True
if check==True:
  print("OK")
else:
  print("NG")

Submission status: Runtime Error

Solution code:
N,M=list(map(int, input().split()))
src=[i+1 for i in range(M*2+1)]
if N%2==0:
  for m in range(M//2):
    a=src[m]
    b=src[M-m]
    print('{} {}'.format(a,b))
  for m in range(M//2):
    a=src[M+1+m]
    b=src[-(m+1)]
    print('{} {}'.format(a,b))
else:
  for m in range(M//2):
    a=src[m]
    b=src[M-1-m]
    print('{} {}'.format(a,b))
  for m in range(M-(M//2)):
    a=src[M+m]
    b=src[-(m+1)]
    print('{} {}'.format(a,b))

Submission status: Runtime Error

Solution code:
M,A,B=(int(x) for x in input().split())
if B//M-A//M>=1:
  print("OK")
elif A%M=0:
  print("OK")
else:
  print("NG")

Submission status: Runtime Error

Solution code:
M,A,B=(int(x) for x in input().split())
if B//M-A//M>=1:
  print("OK")
elif A%M=0:
  print("OK")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
k = input()
a, b = map(int,input().split())

if k*4 >= a:
    if k*4 <= b:
        print("OK")
    else:
        print("NG")

else:
    print("NG")

Submission status: Runtime Error

Solution code:
K = int(input())
A = int(input())
B = int(input())
i = 1
mul = 1
while mul <= B:
    mul = i * K
    if A <= mul <= B:
        print("OK")
        break
    i = i + 1
else :
    print("NG")

Submission status: Runtime Error

Solution code:
K = int(input())
A, B = map(int, input().split())

nK = K
n = 1
ans = "NG"
while(nK=<B):
  if nK >= A:
    ans = "OK"
    break
  n += 1
  nK = n * K
print(ans)

Submission status: Runtime Error

Solution code:
k=int(input())
a,b=map(int,input().split())
for i in range(a,b+1):
  if i%n==0:
    print("OK")
    exit()
print("NG")

Submission status: Runtime Error

Solution code:
k=int(input())
a,b=map(int,input().split())
f=0
for i in range(a,b+1):
  if i%n==0:
    print("OK")
    f=1
if f==0:
  print("NG")

Submission status: Runtime Error

Solution code:
k=int(input())
a,b=map(int,input().split())
for i in range(a,b+1):
  if i%n==0:
    print("OK")
print("NG")

Submission status: Runtime Error

Solution code:
K = int(input())
A = int(input())
B = int(input())
i = A
while A <= i <= B :
    if str(K) in str(i) :
        print("OK")
        break
    i = i + 1
else :
    print("NG")

Submission status: Runtime Error

Solution code:
K = input()
A = int(input())
B = int(input())
i = A
while A <= i <= B :
    if K in str(i) :
        print("OK")
        break
    i = i + 1
else :
    print("NG")

Submission status: Runtime Error

Solution code:
K = input()
A = int(input())
B = int(input())
i = A
while A <= i <= B :
    if K in str(i) :
        print("Yes")
        break
    i = i + 1
else :
    print("No")

Submission status: Runtime Error

Solution code:
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")

Submission status: Runtime Error

Solution code:
input1 = input()
Kbai= int(input1)

input2=input().split(" ")
maxs= int(input2[0])
mins= int(input2[2])
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")

Submission status: Runtime Error

Solution code:
k = int(input())
a,b = map(int(),input().split())

for i in range(k):
    if (a <= i*k):
        if(i*k <=b):
            print('OK')
        else:
            print('NG')
    else:
        i += 1

Submission status: Runtime Error

Solution code:
k = input()
a,b = input().split()

for i in range(k):
    if (a <= i*k):
        if(i*k <=b):
            print('OK')
        else:
            print('NG')
    else:
        i += 1

Submission status: Runtime Error

Solution code:
k = input()
a,b =input().split()

for i in range(k):
    if (a <= i*k):
        if(i*k <=b):
            print('OK')
        else:
            print('NG')
    else:
        i += 1

Submission status: Runtime Error

Solution code:
N,M=map(int,input().split())

x=list(range(1,N+1,1))


if N%2==1:
    for i in range(M):
        print(x.pop(0),x.pop(-1))
        
else:
    x_f=x[1:int(N/2+1)]
    x_l=x[int(N/2+1):]
    
    
    count=0
    
    for i in range(M):
        if len(x_f)>1:
            print(x_f.pop(0),x_f.pop(-1))
            count+=1
            
        if count==M:
            break
        
        if len(x_l)>1:
            print(x_l.pop(0),x_l.pop(-1))
            count+=1
            
        if count==M:
            break

Submission status: Runtime Error

Solution code:
K = int(input())
A, B = map(int, input().split())


if(B > 1000):
    print("NG")
elif(A > 1000):
    print("NG")
elif(A > B):
    print("NG")
else:
    for i in range(A, B):
        if(i%K == 0):
            print("OK")
            j=True

            break
    if(j != False):
        print('NG')

Submission status: Runtime Error

Solution code:
K = int(input())
A = int(input())
B = int(input())


if(B > 1000):
    print("NG")
elif(A > 1000):
    print("NG")
elif(A > B):
    print("NG")
else:
    for i in range(A, B):
        if(i%K == 0):
            print("OK")
            j=True

            break
    if(j != False):
        print('NG')

Submission status: Runtime Error

Solution code:
k = int(input())
a = int(input())
b = int(input())


if(b > 1000):
    print("NG")
elif(a > 1000):
    print("NG")
elif(a > b):
    print("NG")
else:
    for i in range(a, b):
        if(i%k == 0):
            print("OK")
            k=True
            break
    if(k != False):
        print('NG')

Submission status: Runtime Error

Solution code:
k = int(input())
a = int(input())
b = int(input())
print(k, a, b)


if(b > 1000):
    print("NG")
elif(a > 1000):
    print("NG")
elif(a > b):
    print("NG")
else:
    for i in range(a, b):
        if(i%k == 0):
            print("OK")
            k=True
            print(i)
            break
    if(k == False):
        print('NG')

Submission status: Runtime Error

Solution code:
k = int(input())
a = int(input())
b = int(input())


if(b > 1000):
    print("NG")
elif(a > 1000):
    print("NG")
elif(a > b):
    print("NG")
else:
    for i in range(a, b):
        if(i%k == 0):
            print("OK")
            k=True
            print(i)
            break
    if(k == False):
        print('NG')

Submission status: Runtime Error

Solution code:
a = int(input("A:"))
b = int(input("B:"))
k = int(input("K:"))

if(b > 1000):
    print("NG")
elif(a > 1000):
    print("NG")
elif(a > b):
    print("NG")
else:
    for i in range(a, b):
        if(i%k == 0):
            print("OK")
            k=True
            print(i)
            break
    if(k == False):
        print('NG')

Submission status: Runtime Error

Solution code:
k, a, b = input()

int i = b / k
if 
print("OK" if a > i*k else "NG")

Submission status: Runtime Error

Solution code:
k = int(input())
a, b = map(int, input())

ans = 'NG'
if a % k == 0:
  ans = 'OK'
elif b % k == 0:
  ans = 'OK'
elif (b-a) / k > 0:
  ans = 'OK'
print(ans)

Submission status: Runtime Error

Solution code:
k = int(input())
a, b = map(int,input().split())
x = k * (a // k) + k
if k == 1:
    print("OK")
elif : x >= a and x <= b:
    print("OK")
else:
    print("NG")