peterverebics/CodeNet_Python_118 huggingface dataset:
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')
K = int(input())
A,B = map(int,input().split())

for i in range(1020):
    if i>=A and i<= B:
        if i%K==0:
            print("OK")
            break
else:
    print("NG")
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')
k = int(input())
a,b = map(int, input().split())

flg = False
for i in range(a,b+1):
    if i%k == 0:
        flg = True
if flg:
    print('OK')
else:
    print('NG')
K=int(input())
A,B=map(int,input().split())
result=0
for i in range(1000):
  tmp=K*i
  if A<=tmp<=B:
    result=1
    break
  if tmp>B:
    break
if result==1:
  print("OK")
else:
  print("NG")
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 == 1:
    print("OK")
else:
    print("NG")
K=int(input())
A,B =map(int,input().split())
ans = K
i = 1
while True:
    if(ans >=A and ans<=B):
        print("OK")
        break
    if(ans > B):
        print("NG")
        break
    ans = K *i
    i += 1
n = int(input())
a,b = map(int, input().split())

c = 'NG'
for i in range(b-a+1):
  d = a + i
  if d % n == 0:
    c = 'OK'
    
  
print(c)
import math

if __name__ == "__main__":
    K = int(input())
    A, B = map(int, input().split())
    for i in range(A, B+1):
        if i % K == 0:
            ret = "OK"
            break
        else:
            ret = "NG"
    print(ret)
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')
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")
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')
K = int(input())
A, B = map(int, input().split())
result = 'NG'
for i in range (A, B + 1):
    if i % K == 0:
        result = 'OK'
print(result)
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')
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')
k=int(input())
a,b=map(int,input().split())
c=b//k
if a<=k*c:
    print("OK")
else:
    print("NG")
import sys
input=sys.stdin.readline
K=int(input())
A,B=map(int,input().split())
for i in range(1001):
  s=i*K
  if A<=s and s<=B:
    print("OK")
    break
  if 1000<s:
    print("NG")
    break
from math import *
k = int(input())
a, b = map(int, input().split())
for i in range(a, b+1):
	if i%k==0:
		print("OK")
		quit()
print("NG")
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(0)

print('NG')
k=int(input())
a,b=map(int,input().split())
t=a
while t<b+1:
    if t%k==0:
        print("OK")
        exit()
    t+=1
print("NG")
#A
import sys
k = int(input())
a, b = list(map(int, input().split()))
for i in range(a, b+1):
    if i % k == 0:
        print("OK")
        sys.exit()
print("NG")
k=int(input())
a,b=map(int,input().split())
ans=""
if a%k==0:
    ans="OK"
elif b-a>=k-a%k:
    ans="OK"
else:
    ans="NG"
print(ans)
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)
k=int(input())
a,b=map(int,input().split())
n=1
while k*n<=b:
  n+=1
print('OK' if a<=(n-1)*k<=b else 'NG')
k = int(input())
a, b = map(int, input().split())
for i in range(a, b+1):
    if not i % k: print("OK"); break
else: print("NG")
def main():
    K = int(input())
    A, B = list(map(int, input().split(' ')))
    for n in range(A, B + 1):
        if n % K == 0:
            print('OK')
            exit(0)
    print('NG')


if __name__ == '__main__':
    main()
K = int(input())
A, B = map(int, input().split())

MaxKx = B//K*K

if MaxKx >= A :
    print('OK')
else :
    print('NG')
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")
K = int(input())

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

flag = False
for x in range(A, B+1):
  if x % K == 0:
    flag = True


if flag:
  print("OK")
else: 
  print("NG")
K = int(input())
A,B = map(int,input().split())

for i in range(1,1000):
    x = K * i
    if A <= x <= B:
        print('OK')
        exit()
    else:
        continue

print('NG')
K = eval(input())
A, B = [eval(v) for v in input().strip().split(" ")]

i = 1
while K * i <= B:
    if K * i >= A:
        print("OK")
        exit(0)
    i += 1

print("NG")
k = int(input())
a, b = map(int, input().split())

tmp = a

if a % k == 0 or b % k == 0:
  print("OK")
else:
  for i in range(a,b):
    if i % k == 0:
      if i <= b:
        print("OK")
        break
      else:
        print("NG")
        break
  else:
    print("NG")
K = int(input())

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

possible = False

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

if possible:
  print("OK")
else:
  print("NG")
k=int(input())
a,b=[int(i) for i in input().split()]
print("OK" if 0<len([i for i in range(a,b+1) if i%k==0]) else "NG")
k = int(input())
a, b = map(int,input().split())
if a%k == 0 or a//k != b//k:
  print("OK")
else:
  print("NG")
K = int(input())
A, B = map(int, input().split())
if A % K == 0 or ((A // K) + 1)* K <= B:
    print('OK')
else:
    print('NG')
k = int(input())
a,b = map(int,input().split())
chk = False

for i in range(a,b+1):
    if i % k == 0:
        chk = True
        break
      
print("OK") if chk else print("NG")
k=int(input())
a,b=list(map(int,input().split()))
for i in range(a,b+1,1):
  if i % k == 0:
    print("OK")
    exit()
print("NG")
n = int(input())
a, b = map(int, input().split())
ans = 0
for i in range(a, b + 1):
  if i % n == 0:
    ans += 1
    break
print("OK" if ans == 1 else "NG")
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)
n = int(input())
a,b = map(int,input().split())
 
dif = b//n-a//n
 
if dif == 0 and b%n != 0 and a%n !=0 :
  print("NG")
else:
  print("OK")
K=int(input())
A,B=map(int, input().split())
for i in range(1,1001):
    if i%K==0 and A<=i and i<=B:
        print("OK")
        exit()

print("NG")
k = int(input())
a, b = map(int, input().split())
ka = a // k
kb = b // k
if b - a >= k - 1:
  print("OK")
elif kb - ka > 0:
  print("OK")
elif a % k == 0 or b % k == 0:
  print("OK")
else:
  print("NG")
from math import ceil
K = int(input())
A, B = map(int, input().split())
upper = B//K
lower = ceil(A/K)
if upper>=lower:
  print("OK")
else:
  print("NG")
def main(k, a, b):
    for i in range(a, b + 1):
        if i % k == 0:
            print("OK")
            return

    print("NG")


if __name__ == "__main__":
    k = int(input())
    a, b = map(int, input().split())

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

ans = b // k * k
#print(ans)
if ans >= a:
    print("OK")
else:
    print("NG")
k = int(input())
a,b = map(int,input().split())
ans = "NG"
for i in range(a,b+1):
    if not i%k :
        ans = "OK"
        break
print(ans)
K = int(input())
A,B=[int(i) for i in input().split(" ")]
if A%K == 0:
    print("OK")
elif (A//K+1)*K <= B:
    print("OK")
else:
    print("NG")
k = int(input())
a,b = map(int,input().split())

if b//k-a//k > 0 or a%k == 0 or b%k == 0:
    print('OK')
else:
    print('NG')
def main():
    K = int(input())
    a, b = 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")

if __name__ == "__main__":
    main()
k=int(input())
a,b=[int(i) for i in input().split()]
ans=0
for i in range(a,b+1):
    if i%k==0:
        ans+=1
if ans==0:
    print("NG")
else:
    print("OK")
k = int(input())
a, b = map(int, input().split());

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

if x == 0:
    print('NG')
else:
    print('OK')
k = int(input())
a, b = map(int, input().split())

for i in range(a,b+1):
    if i%k==0:
        print("OK")
        quit()
print("NG")
k = int(input())
a, b = map(int, input().split())
c = 0
for i in range(a, b + 1):
    if i % k == 0:
        c = 1
        break
if c == 1:
    print("OK")
else:
    print("NG")
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")
k = int(input())
a,b = map(int,input().split())

found = False

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

if found:
	print("OK")
else:
	print("NG")
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")
def solve(k, a, b):
    for x in range(a, b+1):
        if x % k == 0:
            return True
    return False


if __name__ == "__main__":
    k = int(input())
    a, b = map(int, input().split())
    print("OK" if solve(k, a, b) else "NG")
K = int(input())
A, B = map(int, input().split())
r = 'NG'
for x in range(A, B + 1):
    if x % K == 0:
        r = 'OK'
print(r)
k=int(input())
a,b=map(int,input().split())

if a % k == 0:
    print("OK")
elif (a + k - (a % k)) <= b:
    print("OK")
else:
    print("NG")
import math
k = int(input())
a, b = list(map(int,input().split()))

if math.ceil(a/k)<=math.floor(b/k):
    print('OK')
else:
    print('NG')
K=int(input())
A,B=map(int,input().split())

answer="NG"

for i in range(A,B+1):
    if i%K==0:
        answer="OK"
        break
print(answer)
K = int(input())
A, B = list(map(int, input().split()))
r = K - A % K
if r == K:
    r = 0
if B - A >= r:
    print('OK')
else:
    print('NG')
k=int(input())
a,b=map(int,input().split())
c=0
for i in range(a,b+1):
    if i%k==0:
        c=1
        break
if c==1:
    print('OK')
else:print('NG')
def main():
    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)

if __name__ == '__main__':
    main()
k = int(input())
a, b = map(int, input().split())
p = a % k
q = k - p
if (p == 0) or ((a + q) <= b):
    print('OK')
else:
    print('NG')
N = int(input())
A=input().split()

s=int(A[0])//N
if int(A[0])%N==0:
    print('OK')
else:
    if (s+1)*N>int(A[1]):
        print('NG')
    else:
        print('OK')
k=int(int(input()))
a,b=map(int,input().split())
f=0
for i in range(a,b+1):
    if i%k==0:
        print("OK")
        f=1
        break
if f==0:
    print("NG")
k = int(input())
a, b = map(int, input().split())

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

if f:
    print('OK')
else:
    print('NG')
K = int(input())
A, B = [int(i) for i in input().split()]
print('OK' if (A + K - 1) // K <= B // K else 'NG')
k = int(input())
a,b = map(int,input().split())

target = a
res = 'NG'
while target <= b:
    if target % k == 0:
        res = 'OK'
    target += 1
print(res)
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")
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")
k=int(input())
a,b=map(int,input().split())

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

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

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

a = A//K
b = B//K
c = A%K
d = B%K

if a == b:
    if c == 0 or d == 0:
        print('OK')
    else:
        print('NG')
else:
    print('OK')
k=int(input())
l=list(map(int, input().split(' ')))
a=l[0]
b=l[1]

if (b-a)+1>=k:
    print('OK')
else:
    maybe=(a//k)*k
    ans=False
    while maybe<=b:
        if maybe>=a:
            ans=True
            break
        else:
            maybe+=k
    if ans:
        print('OK')
    else:
        print('NG')
import sys
n = int(input())

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

for i in range(a, b+1):
  if i % n == 0:
    print("OK")
    sys.exit()
print("NG")
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")
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')
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()
else:
    print("NG")
K = int(input())
A, B = map(int, input().split())
cnt = 0
while K * cnt <= 1000:
    if A <= K * cnt <= B:
        print('OK')
        exit()
    cnt += 1
print('NG')
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")
else:
  print("NG")
k = int(input())

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

count=0

c=b-a

ans=0

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

if 0<ans:
    print('OK')

else:
    print('NG')
K = int(input())
A, B = map(int, input().split())

for c in range(A, B + 1):
    if c % K == 0:
        print("OK")
        break
else:
    print("NG")
k=int(input())
a,b= map(int,input().split())
if int(a/k)!=int(b/k):
    print("OK")
elif a%k==0 :
    print("OK")
else:
    print("NG")
k = int(input());
a, b = map(int, input().split());

if (a // k) * k == a or (a // k + 1) * k <= b:
  print("OK");
else:
  print("NG");
k = int(input())
a, b = tuple(map(int, input().split()))

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

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

for i in range(1000):
    if a <= k*i <= b:
        print("OK")
        break
else:
    print("NG")
k = int(input())
a, b = [int(x) for x in input().split()]

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

if B // K > (A-1) // K:
  print("OK")
else:
  print("NG")
k=int(input())
a,b=map(int,input().split())
f=0
for i in range(a,b+1):
    if i%k==0:
        f=1
print('OK' if f==1 else 'NG')
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#l = list(map(int, input().split()))

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")
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")
K = int(input())
A,B = map(int, input().split())

syou = A // K
mod = A % K

if mod == 0:
    print("OK")
    exit()
if (syou*K)+K <= B:
    print("OK")
else:
    print("NG")
# -*- coding: utf-8 -*-
k = int(input())
a, b = map(int, input().split())

msg = 'NG'

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

print(msg)
n = int(input())
a,b = map(int,input().split())
#L = list(map(int,input().split()))
for i in range(a,b+1):
    if i%n == 0:
        print("OK")
        exit()
print("NG")
k = int(input())
A,B = map(int,input().split())
t = (A//k)+1 if A%k != 0 else A//k
s = B//k
print('OK'if t<=s else 'NG')
k = int(input())
a, b = map(int, input().split())  # 入力

if a % k == 0:
    print('OK')
elif b % k == 0:
    print('OK')
elif (int(a / k) + 1) * k < b:
    print('OK')
else:
    print('NG')
import sys
import math

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

if B >= math.ceil(A / K) * K:
    print('OK')
else:
    print('NG')
K=int(input())
A,B=map(int, input().split())

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

if ok==0:
  print('NG')
K = int(input())
A, B = map(int, input().split())
if (A//K + 1 )*K <= B or A%K == 0: 
    print("OK")
else:
    print("NG")
# -*- coding: utf-8 -*-
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)
n = int(input())
a,b = map(int,input().split())
#a_L = list(map(int,input().split()))

for i in range(a,b+1):
    if i%n == 0:
        print("OK")
        exit()
print("NG")
K = int(input())
A,B = map(int, input().split())
str = "NG"
for i in range(A, B+1):
    if i % K == 0:
        str = "OK"
print(str)
ｋ = int(input())
a,b = map(int,input().split())
n=0
while True:
    n+=k
    if n>=a and n<=b:
        print('OK')
        break
    if n>b:
        print('NG')
        break
k = int(input())
a,b = [int(x) for x in 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")
# coding: utf-8
# Your code here!

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

for i in range(A, B + 1):
    if i % K == 0:
        print('OK')
        exit()
else:
    print('NG')
n = int(input())
a,b= map(int, input().split())

i = 0

while (i <= 1000):
    i += n
    if i >= a:
        break

print("OK") if i<=b else print("NG")
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')
#!/usr/bin/python
# -*- coding: utf-8 -*-

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

if A%K == 0:
    print('OK')
elif K*(A//K+1) <= B:
    print('OK')
else:
    print('NG')
k = int(input())
a,b = map(int,input().split())
if ((b//k)*k >= a):
  print("OK")
else:
  print("NG")
import sys
K = int(sys.stdin.readline())
A, B = map(int, sys.stdin.readline().split())
print("OK" if (A <= (B // K) * K) else "NG")
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")
K = int(input())
A, B = map(int, input().split())
flag=0
for i in range(A,B+1):
  if i%K==0:
    print('OK')
    flag=1
    break
if flag==0:
	print('NG')
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)
import sys

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

for i in range(1, 1001):
    if A <= i * K and i * K <= B:
        print("OK")
        sys.exit()
        
print("NG")
k = int(input())
a, b = (int(x) for x in input().split())
if b % k <= b - a:
    print("OK")
else:
    print("NG")
N = int(input())
A,B = map(int,input().split())

for i in range(A,B+1):
  if i%N == 0:
    print('OK')
    exit()
    
print('NG')
k = int(input())
a,b = map(int,input().split())
x = a//k
y = b//k
if y - x == 0:
  if a%k == 0:
    print('OK')
  else:
    print('NG')
else:
  print('OK')
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')
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)
k = int(input())
a, b = map(int, input().split())

list_ab = [i for i in range(a,b+1)]
ans = 'NG'

for j in range(len(list_ab)):
  if list_ab[j] % k ==0:
    ans = 'OK'
    break

print(ans)
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")
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)
k = int(input())
a, b = map(int, input().split())
cnt = 0

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

if cnt == 0:
    print('NG')
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)
k=int(input())
n,m=map(int,input().split())
f=0
for i in range(n,m+1):
    if i%k==0:
        f=1
if f==1:
    print('OK')
else:print('NG')
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")
K=int(input())
A,B=map(int, input().split())
cnt=0

for i in range(B//K+1):
    if A<=K*i and K*i<=B:
        cnt+=1
print('OK' if cnt>0 else 'NG')
K=int(input())
A,B=map(int,input().split())
if (A-1)//K == B//K:
  print('NG')
else:
  print('OK')
k=int(input())
a,b=map(int,input().split())

i=1
while k*i<=b:
  if a<=k*i:
    print('OK')
    exit(0)
  i+=1
print('NG')
#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')
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")
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")
#!/usr/bin/env python3
import collections
import itertools as it
import math
#import numpy as np
 
#  = input()
k  = int(input())
a, b  = map(int, input().split())
#  = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()

for i in range(a, b+1):
    if i % k == 0:
        print('OK')
        break
else:
    print('NG')
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
    print('NG')
    return
main()
K=int(input())
A,B=map(int,input().split())
tmp=0
for i in range(B+1):
    if A<=tmp and tmp<=B:
        print("OK")
        exit()
    tmp+=K

print("NG")
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")
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

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

print("OK" if B // K - (A - 1) // K > 0 else "NG")
def main():
  k=int(input())
  a,b = list(map(int,input().split()))
  flg=0
  for i in range(a , b+1):
    if i%k == 0 :
      flg =1
      break
  
  if flg==1:
    print("OK")
  else:
    print("NG")

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

def check(K,A,B):
    if B//K-(A-1)//K>0:
        return 'OK'
    return 'NG'
print(check(K,A,B))
import sys
input = sys.stdin.readline

# A - We Love Golf
k = int(input())
a, b = map(int, input().split())
i = 1

while True:
	ki = k * i
	
	if ki >= a and ki <= b:
		print('OK')
		sys.exit()
	elif ki > 1000:
		break
	
	i += 1

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

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

for i in range(A, B+1, 1):
  if i % K == 0:
    print('OK')
    break
else:
  print('NG')
K=int(input())
A,B = list(map(int, input().split()))
mini=(A+K-1)//K
if mini*K<=B:
    print("OK")
else: print("NG")
N = int(input())
A, B = map(int, input().split())

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

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

for i in range(N, M + 1):
    if (i / K).is_integer():
        print("OK")
        exit()


print("NG")
k = int(input())
a, b = map(int, input().split())

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

print('NG')
#!/usr/bin/env python
# -*- coding: utf-8 -*-
k = int(input())
a,b = map(int,(input().split()))
flag = False

for i in range(1,b+1):
    if((k * i >= a) and (k * i <= b)):
        flag = True
        break

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