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:
#!/usr/bin/env python3

import sys
# import math
# from string import ascii_lowercase, ascii_upper_case, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import accumulate             # accumulate(iter[, f])
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from copy import deepcopy                    # to copy multi-dimentional matrix without reference
# from fractions import gcd                    # for Python 3.4 (previous contest @AtCoder)


def main():
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79...e+308
    inf = 2 ** 64 - 1               # (for fast JIT compile in PyPy) 1.84...e+19
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    k = ii()
    a, b = mi()
    for i in range(a, b+1):
        if i % k == 0:
            print('OK')
            exit()
    print('NG')


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
K = int(input())
A,B = map(int, input().split())
c = 1 
for i in range(A,B+1):
    if i % K == 0: 
        print("OK")
        c = 0
        break

if not c == 0:
    print("NG")

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1,1001):
  k=K*i
  if A<=k and k<=B:
    print('OK')
    exit()
print('NG')

Submission status: Accepted

Solution code:
import math

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

n = math.ceil(A / K)

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

Submission status: Accepted

Solution code:
k = int(input())
a, b = map(int, input().split())
flag = False
i = 1
while i*k <= b:
    if a <= i*k and i*k <= b:
        flag = True
        break
    i += 1

print("OK") if flag else print("NG")

Submission status: Accepted

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

print("NG")

Submission status: Accepted

Solution code:
K = int(input())
number = input().split(" ")
A = int(number[0])
B = int(number[1])

a = int(A/K)
b = int(B/K)

if A%K == 0 or B%K == 0:
    print("OK")
else:
    if a == b:
        print("NG")
    else:
        print("OK")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def res():
    for i in range(a,b+1):
        if i % k ==0:
            return "OK"
    return "NG"

print(res())

Submission status: Accepted

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

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(0)
print("NG")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
K=int(input())
A,B=map(int,input().split())
c=A//K
d=B//K
if A%K==0:
  print("OK")
elif d>c:
  print("OK")
else:
  print("NG")

Submission status: Accepted

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

for cnt in range(A,B+1):
    if cnt%k == 0:
        print("OK")
        break
    elif cnt == B and cnt%k != 0:
        print("NG")
        break

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# coding: utf-8
# def debug(arg):
#     if __debug__:
#         pass
#     else:
#         import sys
#         print(arg, file=sys.stderr)

def main():
    K, A, B = map(int, open(0).read().split())
    a = 'NG'
    for i in range(A, B + 1):
        if i % K == 0:
            a = 'OK'
    print(a)
if __name__ == "__main__":
    main()

Submission status: Accepted

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

if (B-A) >= K:
  print("OK")
  c = 1
else:
  for i in range(K):
    if ( A + i ) <= B:
      if ( A + i ) % K == 0:
        print("OK")
        c = 1
        break
if c == 0:
  print("NG")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())

b , c = map(int, input().split())
d=0
for i in range(b,c+1):
    if i%a==0:
        d=1

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

Submission status: Accepted

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

flag = 0

list = range(A, B + 1)
for num in list:
  if num % K == 0:
    print('OK')
    flag = 1
    break

if flag == 0:
  print('NG')

Submission status: Accepted

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

if K == 1:
    print('OK')
    exit()

for i in range(A, B+1):
    if i % K == 0:
        print('OK')
        exit()
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:
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())
for k in range(A, B+1):
    if k % K == 0:
        print("OK")
        break
else:
    print("NG")

Submission status: Accepted

Solution code:
k = int(input())
a, b = list(map(int, input().split()))
flg = "NG"
for i in range(a, b + 1):

    if i >= k and i % k == 0:
        flg = "OK"
        break

print(flg)

Submission status: Accepted

Solution code:
k = int(input())
a, b = map(int, input().split())
i = a
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 = map(int, input().split())
list_ = [(i+A) for i in range(B-A+1)]
count = 0
for i in range(len(list_)):
  if list_[i] % K == 0:
    count += 1
    break

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

Submission status: Accepted

Solution code:
n = int(input())
l = list(input().split(" "))
a = int(l[0])
b = int(l[1])
if a%n != 0:
  if b%n != 0 and a//n == b//n:
    print("NG")
  else:
    print("OK")
else:
  print("OK")

Submission status: Accepted

Solution code:

K = int(input())
A,B = map(int,input().split())
flag = False
for i in range(A,B+1):
    if i%K==0:
        flag = True
        break
    else:
        continue
if A==B and A%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())

if B - A >= K:
    print("OK")
elif (B % K) * (A % K) == 0:
    print("OK")
elif B % K < A % K:
    print("OK")
else:
    print("NG")

Submission status: Accepted

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

s = "NG"
value = k
while(value <= b):
    if(a <= value and b >= value):
        s = "OK"
    value += k
print(s)

Submission status: Accepted

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()
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:
k = int(input())
a, b = map(int, input().split())

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

Submission status: Accepted

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

a1 = a//k
b1 = b//k
if (b1>a1):
    print("OK")
elif (a1 == b1 and (a%k == 0 or b%k ==0)):
    print("OK")
else:
    print("NG")

Submission status: Accepted

Solution code:
K=int(input())
A,B=list(map(int,input().split()))
c=K
while c<=B:
  if c>=A and c<=B:
    print("OK")
    break
  else:
    c += K
else:
  print("NG")

Submission status: Accepted

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

Submission status: Accepted

Solution code:


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k = int(input())
a,b = map(int,input().split())
ans = "NG"
if a%k == 0 or b%k == 0:
    ans = "OK"
elif a//k < b //k:
    ans = "OK"
print(ans)

Submission status: Accepted

Solution code:
num = int(input())
min,max = map(int,input().split())

count = 0

for i in range(min,max+1):
    if i%num == 0:
        None
    else:
        count += 1

if count == max-min+1:
    print("NG")
else:
    print("OK")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
K = int(input())
A = list(map(int, input().split()))

ans = ( A[1]//K ) - ( A[0]//K ) 
#print(ans)

if ( A[0]%K==0 or A[1]%K==0 ):
  print("OK")
elif ( ans>0 ):
  print("OK")
else:
  print("NG")

Submission status: Accepted

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

k = math.ceil(a/k)*k

print("OK" if a<=k and k<=b else "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
  if i == B:
    print('NG')
    break

Submission status: Accepted

Solution code:
def mapint_inp():
    return map(int, input().split())

def intinp():
    return int(input())

K = intinp()
A, B = mapint_inp()

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

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:


def solve():
    mult = (a // k + int(a % k > 0)) * k
    if a<= mult <=b:
        print("OK")
    else:
        print("NG")

    return


k = int(input())
a, b = [int(s) for s in input().split(" ")]
solve()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
k = int(input())
a,b = list(map(int,input().split()))
a2 = a//k
a3 = a%k
b2 = b//k
b3 = b%k
if a2 != b2:
    print("OK")
elif a3 == 0 or b3 == 0:
    print("OK")
else:
    print("NG")

Submission status: Accepted

Solution code:

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

    for num in range(0,B+1,K):
        if A<=num and num <=B:
            print("OK")
            return

    print("NG")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import numpy as np
k = int(input())
ab = input()
ab = ab.split()
[a, b] = ab
a, b = int(a), int(b)
a_k = a // k
b_k = b // k
if(b_k > a_k 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())
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())
C = 0
for i in range(A,B+1):
  if i%K == 0:
    print('OK')
    C = 1
    break
if C == 0:
  print('NG')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
INT_MAX=10**11+7
MOD=10**9+7
def INPUT():return list(int(i) for i in input().split())
def LIST_1D_ARRAY(n):return [0 for _ in range(n)]
def LIST_2D_ARRAY(m,n):return [[0 for _ in range(n)]for _ in range(m)]
#=======================================================================
import math as M
k=int(input())
a,b=INPUT()
bool=False
for i in range(a,b+1):
    if i%k==0:
        print("OK")
        bool=True
        break
if bool is False:
    print("NG")

Submission status: Accepted

Solution code:
import sys

K = int(sys.stdin.readline().strip())
A, B = [int(i) for i in sys.stdin.readline().strip().split(" ")]

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

Submission status: Accepted

Solution code:
def main():
    k = int(input())
    a, b = map(int,input().split())
    a_mod = a % k
    a_dev = a // k
    if a_mod != 0 and (a_dev + 1) * k > b:
        print ("NG")
    else:
        print("OK")
      

if __name__ == '__main__':
  main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K = int(input())
a,b = list(map(int, input().split()))
n = 0
while True:
  n += 1
  if a <= n*K and n*K <= b:
    print('OK')
    break
  if b < n*K:
    print('NG')
    break

Submission status: Accepted

Solution code:
import sys
k = int(sys.stdin.readline().rstrip())
a, b = [int(x) for x in sys.stdin.readline().rstrip().split()]

_a = a // k;
_b = b // k;

print("OK" if _b - _a > 0 or a % k == 0 else "NG")

Submission status: Accepted

Solution code:
import math
k=int(input())
m = list(map(int,input().split()))
a=m[0]
b=m[1]
c=0
for i in range(1000):
  j=i+1
  n=k*j
  if a<=n and n<=b:
    c=c+1
if c>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:
        ans = 'OK'
        break
    ans = 'NG'

print(ans)

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')
sys.exit()

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):
        print("OK")
        count=1
        break

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

Submission status: Accepted

Solution code:
K=int(input())
a=[int(x) for x in list(input().split())]
A=a[0]
B=a[1]
import math
if K*math.ceil(A/K) <= B:
    print('OK')
else:
    print('NG')

Submission status: Accepted

Solution code:
S=int(input())
As,Bs=input().split()
#A=input().split()
#A = list(map(int, input().split()))
ans=0

A=int(As)
B=int(Bs)
tmp=A%S
if (A+(S-tmp))<=B:
    print("OK")
elif tmp==0:
    print("OK")

else:
    print("NG")

Submission status: Accepted

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

Submission status: Accepted

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

ans = 'NG'

if a % k == 0 or b % k == 0:
  ans = 'OK'
elif a // k != b // k:
  ans = 'OK'

print(ans)

Submission status: Accepted

Solution code:
k = int(input())
a, b = [int(x) for x in input().split()]
i = 1
ans = "NG"
while True:
    n = k * i
    if n < a:
        i += 1
    elif n > b:
            break
    else:
        if a <= n <= b:
            ans = "OK"
            break
        i += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

k = int(input())
[a,b] = [int(x) for x in input().split()]

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

if temp >= a and temp <= b:
    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(0)
print('NG')

Submission status: Accepted

Solution code:
k = int(input())
n, m =map(int,input().split())
kit = 0
flag = 0
while kit <= m-k :
  kit += k
  if n <= kit:
    print ("OK")
    flag = 1
    break
if flag == 0:
  print("NG")

Submission status: Accepted

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

l = B//K

print("OK" if A <= l*K <= B else "NG")

Submission status: Accepted

Solution code:
k=int(input())
l=list(map(int,input().split()))
x=l[0]//k
if(x*k==l[0] or k*(x+1)<=l[1]):
  print("OK")
else:
  print("NG")

Submission status: Accepted

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

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

print(r)

Submission status: Accepted

Solution code:
K=int(input())
A,B=map(int,input().split())
if ((A // K) < (B // K)) 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_B = []
index = 0

for i in range(0, B - A + 1):
    A_B.append(i+A)

for i in range(0, len(A_B)):
    if A_B[i] % K == 0:
        index = 1
        break

if index == 1:
    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())
for i in range(A,B+1):
    if i % K == 0:
        print('OK')
        exit()
print('NG')

Submission status: Accepted

Solution code:
K=int(input())
A,B = map(int, input().split())
if A//K != B//K:
    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())

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

ans = a-a%k + k

if ans <= b :
    print("OK")
else:
    print("NG")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K=int(input())
AB=input().split(' ')
A,B=int(AB[0]),int(AB[1])

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 = input().split(" ")
a, b = int(a), int(b)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k = int(input())
a, b = (int(each) for each in input().split())

if (a <=(a//k)*k and (a//k)*k <= b) or (a <= ((a//k)+1)*k and ((a//k)+1)*k <= b):
    print('OK')
else:
    print('NG')

Submission status: Accepted

Solution code:
k = int(input())
n,m=list(map(int,input().split()))
if n%k==0:
    print("OK")
else:
    if n-n%k+k<=m:
        print("OK")
    else:print("NG")

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

k = int(readline())
a, b = map(int, read().split())

flg = 0
i = 0

while i < 2000:
    if a <= k*i and b >= k*i:
        flg = 1
        break
    i += 1

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

Submission status: Accepted

Solution code:
num_val = int(input())
num_list = [int(i) for i in input().split()]

if num_val == 1:
    print('OK')
elif (num_list[0] % num_val == 0 ) or (num_list[1] % num_val == 0):
    print('OK')
elif (num_list[0] // num_val) == (num_list[1] // num_val):
    print('NG')
else:
    print('OK')

Submission status: Accepted

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

if sa == 0:
  if B % K == 0:
    print("OK")
    exit()

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

Submission status: Accepted

Solution code:
k = int(input())
a, b = map(int, input().split())
r = 'OK'
x = 1
for i in range(1, 1001):
    x = k * i
    if a <= x <= b:
        break
    elif x > b:
        r = 'NG'
print(r)

Submission status: Accepted

Solution code:

k = int(input())
a, b = (int(x) for x in input().split())

ans = 'NG'

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

print(ans)

Submission status: Accepted

Solution code:
K = int(input())
AB = list(map(int, input().split()))
A = AB[0]
B = AB[1]
run = True
mul = 1
while run:
    if A<=mul*K<=B:
        break
    if mul*K>B:
        run = False
    else:
        mul += 1
if run:
    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
c += 0 if c*k == a else 1
d = c * k

if a <= d <= b:
	print('OK')
else:
	print('NG')

Submission status: Accepted

Solution code:
K = int(input())
A,B = map(int,input().split())
Flag = True
if B-A >= K:
  Flag = False
i = A
while Flag == True and i<B+1 :
  if i%K == 0:
    Flag = False
  i += 1
if Flag == False:
  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:
#coding;utf-8

k = int(input())

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

ra = a % k
a = a + k - ra

if a <= b or ra == 0:
    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:
#!/usr/bin/env python3
import sys


def solve(K: int, A: int, B: int):
    n = ((A-1) // K +1)*K
    print('OK' if A <= n and n <= B else 'NG')
    return


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())
s=""
for i in range(a,b+1):
  if i%k==0:
    s="OK"
    print(s)
    break
if s!="OK":
  print("NG")

Submission status: Accepted

Solution code:
K = int(input())
A_B = input().split()
A = int(A_B[0])
B = int(A_B[1])

for n in range(A, B+1):
    if n % K == 0:
        print("OK")
        break
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 == 0:
  print("NG")
else:
  print("OK")

Submission status: Accepted

Solution code:
S = int(input())
a = 0
count = 0
n,m = map(int,input().split())
while count == 0:
    a += S
    if n <= a and m >= a:
        count = 1
    if a >= 1000:
        break
if count == 0:
    print("NG")
else:
    print("OK")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
k=int(input())
a,b=map(int,input().split())
if b//k-a//k>=1:
  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())



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

Submission status: Accepted

Solution code:
import sys
K = int(input())
A,B = map(int,input().split())
for i in range(1001):
    if A<=i*K and i*K<=B:
        print("OK")
        sys.exit()
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()))

x = int(a / k)
y = int(b / k)
rx = a % k
ry = b % k

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

if y - x >= 1 or rx * ry == 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')
        quit()
else:
    print('NG')

Submission status: Accepted

Solution code:

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

while 1:
    if A <= k and k <=B:
        f=True
        break
    if B < k:
        break
    k+=K

if f:
    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

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 == 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())
dflag = False
for i in range(1000):
  if (a <= i * k <= b):
    dflag = True
    break
if dflag == True:
  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'
print(ans)

Submission status: Accepted

Solution code:
K = int(input())
A, B = map(int, input().split())
ans = 1
for i in range(100000):
    ans = i * K
    if A <= ans and ans <= B:
        print("OK")
        exit()
print("NG")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=int(input())
b=list(map(int,input().split()))
i=2
out='NG'
c=a
while c<=b[1]:
  if c >=b[0]:
    out='OK'
    break
  else:
    c=a*i
    i+=1

print(out)

Submission status: Accepted

Solution code:
k = int(input())
import math
a, b = map(int, input().split())
c = math.ceil(a//k)
d = math.ceil(b//k)
if d - c >= 1 or a%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
    elif i == b:
        print('NG')