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: Accepted

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

Submission status: Accepted

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

for i in range(1,1020):
  if K*i >= A and K*i <= B:
    print('OK')
    #print(K*(c+i))
    exit()
  i+=1
print('NG')

Submission status: Accepted

Solution code:
K = int(input())
A, B = [int(x) for x in input().split()]
flag = 0
for x in range(1, 1001):
    if A <= x * K <= B:
        print("OK")
        flag = 1
        break
if flag == 0:
    print("NG")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))  # 入力のときに N を使う必要はありません
icount = 0
if A[1] - A[0] >= N:
  print('OK')
  icount = icount + 1
else:
  for i in range(A[0], A[1]+1):
    if i % N == 0:
      print('OK')
      icount = icount + 1
      if icount == 1:
        break
      
if icount == 0:
  print('NG')

Submission status: Accepted

Solution code:
k = int(input())
a,b = list(map(int,input().split()))
ret = ""
q = a//k
if a <= q*k or (q+1)*k <= b:
    ret = "OK"
else:
    ret ="NG"
print(ret)

Submission status: Accepted

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

if flg:
	print('OK')
else:
	print('NG')

Submission status: Accepted

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

if(a//x == b//x):
  if(a/x == a//x  or  b/x == b//x):
    print('OK')
  else:
    print('NG')
else:
  print('OK')

Submission status: Accepted

Solution code:
import sys

def main():
    k = int(input())
    a,b = map(int, input().split())
    n = "OK"
    for ai in range(a,b+1):
        if ai%k==0:
            n = "OK"
            break
            sys.exit()
        else:
            n="NG"
    print(n)
    
if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    K = int(input())
    A, B = map(int, input().split())
    cnt = 1
    while cnt * K <= B:
        if A <= K * cnt and K * cnt <= B:
            print('OK')
            exit()

        cnt += 1
    print('NG')

Submission status: Accepted

Solution code:
def Sol(n,a,b):
    
    m = b%n
    if b-m >= a:
        print("OK")
    else:
        print("NG")
    
    return

    
n = int(input())

#for t in range(int(input())):
a,b = map(int,input().split())
#    arr = []
#    for i in range(c):
#        arr.append(list(map(int,input().split())))
#arr = list(map(int,input().split()))
#k = input()
#n = int(input())
Sol(n,a,b)

Submission status: Accepted

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

Submission status: Accepted

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

if (((int(A)//K)+1) <= (int(B)//K)):
    print("OK")
elif(K==1):
    print("OK")
elif(int(A)%K==0):
    print("OK")
else:
    print("NG")

Submission status: Accepted

Solution code:
k = int(input().strip())
num = list(map(int, input().split()))
count = k
while 1:
    if num[0] <= k <= num[1]:
        print('OK')
        break
    elif num[1] < k:
        print('NG')
        break
    else:
        k += count

Submission status: Accepted

Solution code:
K = int(input())
A,B = map(int,input().split())
A_amari = A % K
B_amari = B % K
if A_amari == 0 or B_amari == 0:
	print("OK")
elif B_amari < A_amari:
	print("OK")
elif B - A >= K:
	print("OK")
else:
	print("NG")

Submission status: Accepted

Solution code:
from sys import stdin
import math


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    K = int(_in[0])  # type:int
    A,B = list(map(int,_in[1].split(' ')))  # type:list(int)
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    TF = 'OK' if math.ceil(A/K)<=math.floor(B/K) else 'NG'
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(TF)

Submission status: Accepted

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

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


if(flag):
    print('OK')
else:
    print('NG')

Submission status: Accepted

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

Submission status: Accepted

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

A_flg = False
B_flg = False

c = int(A/K)
if c*K < A:
    c +=1



if c*K <=B:
    print("OK")
else:
    print("NG")

Submission status: Accepted

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

Submission status: Accepted

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

OK = False

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

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

Submission status: Accepted

Solution code:
k = int(input())
a, b = (int(i) for i in input().split(" "))
i2 = a % k
if i2 == 0:
    i2 = k
i3 = a - i2 + k
if i3 <= b:
    print("OK")
else:
    print("NG")

Submission status: Accepted

Solution code:
def main():
    import sys
    import math
    input = sys.stdin.readline
    K = int(input())
    A,B=map(int,input().split())
    
    answer="OK"
    for x in range(A,B+1):
        if x%K==0:
            print(answer)
            sys.exit()
        
    answer="NG"
    print(answer)



if __name__ == '__main__':
    main()

Submission status: Accepted

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")

Submission status: Accepted

Solution code:
str1 = int(input())
str2 = input().split()
 
use = int(str2[0])
 
ok_count = 0
 
while int(str2[1]) >= use:
    if use % str1 == 0:
        ok_count = 1
    use = use + 1
 
if ok_count == 1 :
    print("OK")
else:
    print("NG")

Submission status: Accepted

Solution code:
# 初期入力
import sys
#input = sys.stdin.readline
K = int(input())
A,B = (int(x) for x in input().split())

distance =0
kekka ="NG"
for i in range(10):
    distance =K *(i + A//K)
    if A<=distance and distance <=B:
        kekka ="OK"
        #print(distance)
        break
print(kekka)

Submission status: Accepted

Solution code:
prime = int(input())
range1 = list(map(int, input().split()))

for i in range(range1[0],range1[1]+1):
  mod = i % prime
  if mod == 0:
    print("OK")
    break
  if i == range1[1] and mod != 0:
    print("NG")

Submission status: Accepted

Solution code:
k = int(input())

a,b = map(int,input().split(' '))

count = 0
for i in range(b-a+1):
    if (a + i) % k == 0:
        count += 1
if (b-a) / k >= 1:
    print('OK')
elif count == 1:
    print('OK')
else:
    print('NG')

Submission status: Accepted

Solution code:
k = int(input())
a,b = (int(x) for x in input().split())
i=a
while True:
    if i%k == 0:
        print("OK")
        break
    i+=1
    if i>b:
        print("NG")
        break

Submission status: Accepted

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')

Submission status: Accepted

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

Submission status: Accepted

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

if A % K == 0:
    print('OK')
else:
    if ((A // K)+1) * K > B:
        print('NG')
    else:
        print('OK')

Submission status: Accepted

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

Submission status: Accepted

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

ans='NG'

for i in range(b+1):
    c=n*i
    if c>=a and c<=b:
        ans='OK'
        break

print(ans)

Submission status: Accepted

Solution code:
k = int(input())
a, b = input().split()
a = int(a)
b = int(b)
if a - a % k + k <= b or a % k == 0 or b % k == 0:
  print('OK')
else:
  print('NG')

Submission status: Accepted

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')

Submission status: Accepted

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")
        exit()

print("NG")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

if __name__ == '__main__':
    #S,W = int(s[0]), int(s[1])
    K = int(input())
    s = input().rstrip().split(' ')
    A,B = int(s[0]), int(s[1])
    C,D = float(A/K), float(B/K)
    E = math.ceil(C)
    if K == 1:
        print('OK')
    else:
        print('OK' if C <= E and E <= D else 'NG')

Submission status: Accepted

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

Submission status: Accepted

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

while A<B and A%K!=0:
  A+=1

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

Submission status: Accepted

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

if a%k == 0:
    res_k = a
else:
    res_k = (a//k + 1)*k

if (res_k >= a) and (res_k <= b):
    print('OK')
else:
    print('NG')

Submission status: Accepted

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

# a = int(A)
# b = int(B)
k = int(K)

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

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

Submission status: Accepted

Solution code:
K=int(input())
a,b=map(int,input().split())
c=a//K
d=b//K
if b-a>=K:
  print('OK')
elif d-c>=1:
  print('OK')
else:
  if a%K==0 or b%K==0:
    print('OK')
  else:
    print('NG')

Submission status: Accepted

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

for x in range(A-1,B):
  if (x+1) % K == 0:
    c += 1
    break

if c == 1:
  print("OK")
else:
  print("NG")

Submission status: Accepted

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

if a//k == b//k:
    if a%k == 0:
        print("OK")
    else:
        print("NG")
else:
    print("OK")

Submission status: Accepted

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

if k<a:
  if a%k == 0:
    print("OK")
  elif b%k == 0:
    print("OK")
  elif(a+(k-a%k)) <= b:
    print("OK")
  else:
    print("NG")
elif k<=b:
  print("OK")
else:
  print("NG")

Submission status: Accepted

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

i=0

while True:
  if (a+i)%k==0:
    print('OK')
    break
  
  if  a+i==b:
    print('NG')
    break
  
  i+=1

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

K, A, B = map(int, read().split())
x = B // K - (A - 1) // K
print('OK' if x else 'NG')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K = int(input())
A,B = map(int,input().split())
K1 = 0
flag = 0
while K1 <= B:
    K1 = K1 + K 
    if A <= K1 <= B:
        print("OK")
        flag = 1
        break
if flag == 0:
    print("NG")

Submission status: Accepted

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

Submission status: Accepted

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

if (a % k) == 0 or a + k - (a % k) <= b:
  print("OK")
else:
  print("NG")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


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


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    K = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(K, A, B)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
K = int(input())
A, B = map(int, input().split())
 
N = A // K
 
if K*(N+1) <= B:
  print("OK")
elif A == K*N:
  print("OK")
else:
  print("NG")

Submission status: Accepted

Solution code:
K = int(input())
A,B = map(int,input().split())
a = A// K
b = B // K
if a != b and a !=0 or A % K == 0 or B % K ==0:
    print('OK')
else:
    print('NG')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
K = int(input())
A, B = map(int, input().split())
can=False
count = 1
a = K

while(a <= B):
    a = count * K
    count += 1
    
    if(a>=A and a<=B): can=True

if(can):print('OK')
else: print('NG')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
num = int(input())

hani = input().split()
flag = 0
for i in range(int(hani[0]),int(hani[1])+1):
    if (int(i) % num) == 0:
        flag = 1
        break
if flag == 1:
    print("OK")
else:
    print("NG")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# n,m = map(int,sys.stdin.readline().split())
# a = list(map(int,sys.stdin.readline().split()))
# a = [sys.stdin.readline() for _ in range(n)]
# s = sys.stdin.readline().rstrip()
# n = int(sys.stdin.readline())
import sys,bisect,math
sys.setrecursionlimit(15000)

K = int(sys.stdin.readline())
A,B = map(int,sys.stdin.readline().split())

if A%K == 0 or B%K == 0:
    print("OK")
    exit()
if A//K == B//K:
    print("NG")
    exit()
print("OK")

Submission status: Accepted

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

k = int(input())
a, b = map(int, input().replace("\n","").split())

if a == b:
    if a % k == 0:
        print("OK")
        exit()

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

print("NG")

Submission status: Accepted

Solution code:
#---We Love Golf

K = int(input())
a, b = map(int, input().split())

#judge = b - a

q_1, mod_1 = divmod(a,K)
q_2, mod_2 = divmod(b,K)

if(K == 1 or b == K or a == K or mod_1 == 0 or mod_2 == 0):
  print("OK")
  exit()

if(q_1 != q_2):
  print("OK")
else:
  print("NG")

Submission status: Accepted

Solution code:
k = int(input())
a,b = map(int,input().split())
if a == b and a%k == 0:
    print("OK")
elif b-a >= k:
    print("OK")
else:
    if a%k == 0 or b%k == 0:
        print("OK")
    elif a//k != b//k:
        print("OK")
    else:
        print("NG")

Submission status: Accepted

Solution code:
k = int(input())
a, b = map(int, input().split())
flag = 0
for i in range(1001):
    if a <= k*i <= b:
        flag = 1

if flag == 1:
    print("OK")
else:
    print("NG")

Submission status: Accepted

Solution code:
K = int(input())
 
A,B=map(int,input().split())
 
if (int(B/K) - int((A-1)/K) ) >=1 :
    print('OK')
else :
    print('NG')

Submission status: Accepted

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

fly=0
l=[]
while fly<b:
    fly += k
    l.append(fly)
    
if len(l)==1:
    if k>=a and k<=b:
        print('OK')
    else:
        print('NG')
else:
    if l[-1]>=a and l[-1]<=b:
        print('OK')
    elif l[-2]>=a and l[-2]<=b:
        print('OK')
    else:
        print('NG')

Submission status: Accepted

Solution code:
K = int(input())
A,B = (int(x) for x in input().split())
c = A // K
while True:
    if K == 1:
        print('OK')
        break
    b = K * (c)
    if b >= A and b <= B:
        print('OK')
        break
    elif b > B:
        print('NG')
        break
    c += 1

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
K = int (input())
line= list(map(int,input().split()))
a,b = line[0],line[1]
if b<K:
    print("NG")
    

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

Submission status: Accepted

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

listK = [K*i for i in range(1, 1000) if K*i<=1000]

for j in listK:
    if A<=j and j<=B:
        print('OK')
        exit()

print('NG')

Submission status: Accepted

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

min=(a//k)+1
if a%k==0:
    print("OK")
else:
    if a<=k*min and k*min<=b:
        print("OK")
    else:
        print("NG")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k = int(input())
a, b = list(map(int, input().split()))
print("OK") if b % k <= b - a else print("NG")

Submission status: Accepted

Solution code:
import math
K=int(input())
A,B=[int(i)for i in input().split()]
a=math.ceil(A/K)
print("OK" if B>=a*K else "NG")

Submission status: Accepted

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

while A < B and A % K != 0 :
    A += 1

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

Submission status: Accepted

Solution code:
#


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K=int(input())
A,B=map(int,input().split())
n=0
for i in range(A,B+1):
    if i%K==0:
        n+=1

if n==0:
    print('NG')
else:
    print('OK')

Submission status: Accepted

Solution code:
num=int(input())
date1=input().rstrip().split(" ")
A=int(date1[0])
B=int(date1[1])
C=int((A-A%num)/num)
D=int((B-B%num)/num)
if A%num==0 or B%num==0:
    print("OK")
elif C==D:
    print("NG")
else:
    print("OK")

Submission status: Accepted

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

con = 0
ans = 0

for i in range(1,144):
    ans = K * i

    if(A<=ans and ans<=B):
        print("OK")
        break

    else:
        con += 1
        continue


        

if(con==143):
    print("NG")

Submission status: Accepted

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

ans=False

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

if(ans):
    print("OK")
else:
    print("NG")

Submission status: Accepted

Solution code:
K=int(input())
A,B = map(int, input().split())
a=[]
i=1
while True:
    if K*i<=1000:
        a.append(K*i)
        i=i+1
    else:
        break
s=0
for i in a:
    

    if A<=i<=B:
        s=1
        
        break
if s==0:
    print("NG")
if s==1:
    print("OK")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

flg = False
for i in range(A, B):
	if i % K == 0:
		flg = True
		break

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

Submission status: Accepted

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

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

if count >=1:
  print("OK")
if count==0:
  print("NG")

Submission status: Accepted

Solution code:
import bisect
import copy
import heapq
import sys
import itertools
import math
import queue
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
mod = 10 ** 9 + 7

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]
def init_dp1(init, N): return [init for _ in range(N)]
def init_dp2(init, N, M): return [[init for _ in range(M)] for _ in range(N)]


class V:
    def __init__(self, f, v=None):
        self.f = f
        self.v = v
 
    def __str__(self):
        return str(self.v)
 
    def ud(self, n):
        if n is None:
            return

        if self.v is None:
            self.v = n
            return
        self.v = self.f(self.v, n) 


def main():
    K = int(input())
    A, B = read_values()
    if A % K == 0 or B % K == 0:
        print("OK")
    elif (B // K - A // K) > 0:
        print("OK")
    else:
        print("NG")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
K = int(input())

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

count = 0

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

if(count > 0):
    print("OK")
else:
    print("NG")

Submission status: Accepted

Solution code:
K = int(input())
A,B = map(int,input().split())
x = A % K
if A % K == 0 or B % K == 0:
    print("OK")
elif K - x <= B-A:
    print("OK")
else:
    print("NG")

Submission status: Accepted

Solution code:
#n=int(input())
#n,m=list(map(int,input().split()))
#a=list(map(int,input().split()))
import math
import itertools
from collections import defaultdict
from collections import Counter
import numpy as np

import heapq
k=int(input())
a,b=list(map(int,input().split()))

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

print("NG")

Submission status: Accepted

Solution code:
k = int(input())
param = list(map(int, input().split()))
a = int(param[0])
b = int(param[1])

ret = 'NG'
tmp = k
while tmp <= b:
    if a <= tmp:
        ret = 'OK'
    tmp += k
  
print(ret)

Submission status: Accepted

Solution code:
listA=[] #appendのために宣言が必要
while True:
    try:
        listA.append(list(map(int,input().split())))

    except:
        break;
        #または、quit(),os.exit()をして止める。

a = listA[0][0]
b = listA[1][0]
c = listA[1][1]

if b % a == 0:
  print ('OK')

d = b // a

if b % a !=0:
  if a * (d+1) <= c:
    print ('OK')
  else:
    print ('NG')

Submission status: Accepted

Solution code:
k = int(input().strip())
a, b = input().strip().split()
a = int(a)
b = int(b)
c = 0
for i in range(1,1001):
    if i*k <= b and i*k >= a:
        print("OK")
        c = 1
        break
if c == 0:
    print("NG")

Submission status: Accepted

Solution code:
K = int(input())
A = list(map(int, input().split()))
d=A[1]-A[0]+1
ok=0

for i in range(d):
    if A[0]%K==0:
        print("OK")
        ok+=1
        break
    else:
        a=A[0]
        A[0]=a+1

if ok==0:
    print("NG")

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(a,b+1):
  if i%k==0:
    flag=flag+1
  else:
    pass

if flag>=1:
  print('OK')
else:
  print('NG')

Submission status: Accepted

Solution code:
base = int(input())
min,max = map(int, input().split())
for num in range(min,max+1):
  if num % base == 0:
    print('OK')
    break
else:
  print('NG')

Submission status: Accepted

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

count = 0
for i in range(c,d+1):
    if a <= k*i and k*i <= b:
        count += 1
if count >= 1:
    print("OK")
else:
    print("NG")

Submission status: Accepted

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: Accepted

Solution code:
n = int(input())
i,j = [int(e) for e in input().split()]
#print(n,i,j)

a = i // n
b = j // n
ans = 'NG'
if a < b:
  ans = 'OK'
else:
  if i % n == 0:
    ans = 'OK'

print(ans)

Submission status: Accepted

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

q, r = divmod(a, k)
Q, R = divmod(b, k)

if q < Q:
    print('OK')
else:
    if r == 0:
        print('OK')
    else:
        print('NG')

Submission status: Accepted

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

i = 1
flg = 0
tmp = K
while(K <= B):
    K =  tmp * i
    #print(K)
    if(A <= K <= B):
        flg = 1
        break
    i += 1

if(flg == 1):
    print('OK')
else:
    print('NG')

Submission status: Accepted

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

res_A = A // K
res_B = B // K

if ((res_A + 1) * K <= B):
    print("OK")
elif(A % K ==0 or B % K ==0 ):
    print("OK")
else:
    print("NG")

Submission status: Accepted

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

c = list(range(a,b+1))
d = []

for i in range(len(c)):
    if c[i] % k == 0:
        d.append('A')

if len(d) >= 1:
    print('OK')
else:
    print('NG')

Submission status: Accepted

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()
    else:
        continue
print("NG")

Submission status: Accepted

Solution code:
# import numpy as np
# import queue
# import heapq


def main():
    print(resolve())


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

    for n in range(A, B+1):
        if n % K == 0:
            return 'OK'

    return 'NG'


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
k = int(input())
l = input().split()
a = int(l[0])
b = int(l[1])
for i in list(range(a, b+1)):
  if i % k == 0:
    print('OK')
    break
  elif i == b:
    print('NG')

Submission status: Accepted

Solution code:
K=int(input())
A,B=map(int, input().split())
 
if K>B :
    print("NG")
elif A<=K<=B :
    print("OK")
elif K<A and 2*K>B :
    print("NG")
elif K<A and 2*K<=B :
    print("OK")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K = int(input())
A,B = map(int, input().split())
C = K
count = 1
ans = "NG"

while (C<=B):
    #print("test")
    if(A<=C and C<=B):
        ans ="OK"
    C = K*count
    count += 1
    #print(C)


print(ans)

Submission status: Accepted

Solution code:
s = [input() for i in range(2)]
n = int(s[0])
l = s[1].split()
n1 = int(l[0])
n2 = int(l[1])
m="NG"
i=n1
while i <= n2:
    if i % n==0:
        m = "OK"
        break
    i +=1
print(m)

Submission status: Accepted

Solution code:
k=int(input())
a,b=map(int,input().split())
c=b//k
if a<=k*c:
    print("OK")
else:
    print("NG")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(a, b, k):
    if a % k == 0:
        return a % k == 0
    return a / k < b / k

assert solve(12, 14, 4)
assert solve(11, 11, 1)
assert solve(11, 12, 1)
assert solve(11, 12, 3)
assert solve(11, 12, 5) == False
assert solve(3, 3, 3)
assert solve(1, 2, 3) == False
assert solve(5, 7, 4) == False
assert solve(7, 7, 7)
assert solve(3, 7, 4)
assert solve(5, 8, 4)
assert solve(5, 9, 4)
assert solve(500, 600, 7)

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

print 'OK' if solve(a, b, k) else 'NG'

Submission status: Accepted

Solution code:
k = int(input())
a, b = map(int, input().split())
t = a%k
if t==0:
    print("OK")
else:
    if k-t <= b-a:
        print("OK")
    else:
        print("NG")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K = int(input())
a, b = map(int, input().split())
for i in range(1,1000):
    c = K*i
    if a <= c <= b:
        print("OK")
        test = 1
        break
    else:
        test = 0
        continue
if test == 0:
    print("NG")

Submission status: Accepted

Solution code:
k = int(input())
a, b = list(map(int, input().split()))
d = k - a % k
if (a % k != 0 and a + d > b):
  print("NG")
else:
  print("OK")