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:
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H):
    '''
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9
# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right
from math import gcd

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

Submission status: Accepted

Solution code:
N = int(input())
A=[int(x) for x in input().split()]
k=0
if N==1:
    print("OK")
else:
     if A[0]//int(N) == A[1]//int(N)  and A[0]%int(N)!=0  and A[1]%int(N)!=0:
        print("NG")
     else:
         print("OK")

Submission status: Accepted

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

a = arr[0]
b = arr[1]

count=0

now_max = arr[0]

for num in range(a,b+1):
    if num%k==0:
        print('OK')
        break
    elif num==b and num%k!=0:
        print('NG')

Submission status: Accepted

Solution code:
k = int(input())
a,b = map(int,input().split())
c = b - a
lis = []
if k == 1:
    print("OK")
elif b - a >= k:
    print("OK")
else:
    for i in range(c+1):
        d = (a + i)% k
        lis.append(d)
    if lis.count(0) == 0:
        print("NG")
    else:
        print("OK")

Submission status: Accepted

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


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

c = b//k

if k == 1:
    print("OK")
else:
    if c * k >=a:
        print("OK")
    else:
        print("NG")

Submission status: Accepted

Solution code:
k=int(input())
a,b=map(int,input().split())
r=b-a
d=k-(a%k)
if d==k:
    print("OK")
elif r>=d:
    print("OK")
else :
    print("NG")

Submission status: Accepted

Solution code:
k = int(input())
a, b = [int(x) for x in input().split()]
result = False
check = [x*k for x in range(0, 1000)]
for i in check:
    if (i >= a and i <= b):
        result = True
    else:
        continue

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

Submission status: Accepted

Solution code:
k = int(input())
n, m = map(int, input().split())

if n % k == 0 or m % k == 0:
    print("OK")
    exit()

l = n // k + 1
if l * k <= m:
    print("OK")
else:
    print("NG")

Submission status: Accepted

Solution code:
from sys import stdin

def main():

    input = stdin.readline

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K = int(input())
score = input().split()
s1 = int(score[0])
s2 = int(score[1])
if ( s1 % K ) == 0:
		print('OK')
elif ( s2 % K ) == 0:
		print('OK')
elif ( s1 // K ) < ( s2 // K ):
		print('OK')
else:
		print('NG')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
k = int(input())
a, b = map(int, input().split())

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    K = int(rl())
    A, B = map(int,rl().split())
    for i in range(A, B + 1):
        if i % K == 0:
            print("OK")
            exit()
    print("NG")


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

d_u=int(B/K)
r_u=B%K
d_l=int(A/K)
r_l=A%K

if (r_u*r_l == 0) or not(d_u == d_l):
  print("OK")
else:
  print("NG")

Submission status: Accepted

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

n_1 = int(A / n)
n_2 = int(B / n)
nn_1 = A%n
nn_2 = B%n
if n == 1: print('OK')
else:
    if nn_1 ==0 or nn_2 == 0:print('OK')
    elif n_2 != n_1: print('OK')
    else: print('NG')

Submission status: Accepted

Solution code:
k = int(input())
l = list(map(int, input().split()))
if (l[1] - l[0]) >= k or l[0] % k == 0 or l[1] % k == 0:
  print("OK")
else:
  while l[0] != l[1]:
    l[0] += 1
    if l[0] % k == 0:
      print("OK")
      exit()
  print("NG")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k = int(input())
arr = input().split(" ")
m, n = int(arr[0]), int(arr[1])
if n%k==0 or m%k==0 or n//k!=m//k:
  print('OK')
else:
  print('NG')

Submission status: Accepted

Solution code:
N = int(input())
L= list(map(int,input().split()))
min = L[0]
max = L[1]

for i in range(min,max+1):
  if i % N == 0:
    print("OK")
    break
else:
  print("NG")

Submission status: Accepted

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

if any(i % k == 0 for i in X):
  print('OK')
  
else:
  print('NG')

Submission status: Accepted

Solution code:
i=int(input())
n,m=map(int,input().split())
s=[]
if n%i==0:
  print('OK')
elif m%i==0:
  print('OK')
else:
  for j in range(n,m+1):
    if j%i==0:
      s.append(j)
  if len(s)>0:
    print('OK')
  else:
    print('NG')

Submission status: Accepted

Solution code:
k = int(input())
a,b = map(int, input().split())
c = b//k
if c*k >= a:
    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())
aa=a//k
bb=b//k
aaa=a%k
bbb=b%k

if aa!=bb:
  print('OK')
elif aaa==0:
  print('OK')
elif bbb==0:
  print('OK')
else:
  print('NG')

Submission status: Accepted

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

i = 0
flg = 0
while i <= b:
    i += n
    if a <= i <= b:
        print('OK')
        flg = 1
        break
if flg == 0:
    print('NG')

Submission status: Accepted

Solution code:
x = int(input())
x2,y2= map(int,input().split())
z=0
while(True):
  z=z+x
  if z>=x2 and z<=y2:
    print("OK")
    break
  if z>1000:
    print("NG")
    break

Submission status: Accepted

Solution code:
K = int(input())
A,B = list(map(int,input().split()))
K2 = 0
num = []
for i in range(1,1000):
  K2 = K * i
  if K2 > 1000:
    break
  else:
    num.append(K2)
      
for i in range(A,B+1):
  if i in num:
    print("OK")
    break
  else:
    if i == B:
      print("NG")
      break

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())
x = B - A
ans = "NG"
s = list(range(A,A+x+1))

for i in range(x+1):
  y = s[i]
  if not y%K == 0:
    ans = "NG"
  else:
    ans = "OK"
    break
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
k = int(input())
a,b=map(int,input().split())
for n in range(1002):
    if b>=k*n>=a:
        print('OK')
        exit()
print('NG')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k = int(input())
a,b = map(int, input().split())
c,d,e,f,g = a%k,b%k,a//k,b//k,0
if c!=0 and d!=0:
    if e == f:
        if d >= c:
            g = 1

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

Submission status: Accepted

Solution code:
# 標準入力
a = input()
b, c = input().split()
#print(list)

flag = False

for num in range(int(b), int(c) + 1):
    #print(num)
    if num % int(a) == 0:
        flag = True

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K=input()
A,B=(input().split())
x=int(A)
while x<=int(B):
    if x % int(K) ==0:
        print('OK')
        break
    elif x==int(B):
        print('NG')
        break
    else:
        x+=1

Submission status: Accepted

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

syou = a // k
amari = a % k

if amari == 0:
    print('OK')
elif b >= (syou * k + k):
    print('OK')
else:
    print('NG')

Submission status: Accepted

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

for a in range(1000):
    if a * K >= A:
        if a * K <= B:
            print("OK")
            break
else:
    print("NG")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A = int(input())
X,Y = map(int,input().split())

C = X//A
if A*(C+1) <= Y and X <= A*(C+1):
  print("OK")
elif X%A == 0:
  print("OK")
else:
  print("NG")

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

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

Submission status: Accepted

Solution code:
k = input()
a, b = (int(x) for x in input().split())
K = int(k)
A = int(a)
B = int(b)
C = B - A + 1
p = 1

for p in range(C):
    if A % K == 0:
        i = 1
        break
    else:
        A += 1
        i = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K = int(input())
A, B = input().split()
a = int(A)
b = int(B)
k = 1
while k <= 1000:
    key = K*k
    if (key >= a) and (key <= b):
        print("OK")
        break
    elif (key >= b):
        print("NG")
        break
    k += 1

Submission status: Accepted

Solution code:

K = int(input())
A, B = [int(x) for x in input().split(" ")]
this = A // K
tag = 0
for i in range(this*K, B+1, K):
    if(A<=i<=B):
        tag = 1
        break
if tag == 1:
    print("OK")
else:
    print("NG")

Submission status: Accepted

Solution code:
import math

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

if math.floor(b/k) - math.floor(a/k) > 0 or a % k == 0:
    print("OK")

else:
    print("NG")

Submission status: Accepted

Solution code:

# Author : devil9614 - Sujan Mukherjee

from __future__ import division, print_function

import os,sys
import math
import collections
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip


def ii(): return int(input())
def si(): return input()
def mi(): return map(int,input().strip().split(" "))
def msi(): return map(str,input().strip().split(" "))
def li(): return list(mi())

def dmain():
    sys.setrecursionlimit(100000000)
    threading.stack_size(40960000)
    thread = threading.Thread(target=main)
    thread.start()
    
#from collections import deque, Counter, OrderedDict,defaultdict
#from heapq import nsmallest, nlargest, heapify,heappop ,heappush, heapreplace
#from math import log,sqrt,factorial
#from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
#from decimal import *,threading
#from itertools import permutations
#Copy 2D list  m = [x[:] for x in mark] .. Avoid Using Deepcopy

abc='abcdefghijklmnopqrstuvwxyz'
abd={'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod=1000000007
#mod=998244353
inf = float("inf")
vow=['a','e','i','o','u']
dx,dy=[-1,1,0,0],[0,0,1,-1]
def getKey(item): return item[1] 
def sort2(l):return sorted(l, key=getKey,reverse=True)
def d2(n,m,num):return [[num for x in range(m)] for y in range(n)]
def isPowerOfTwo (x): return (x and (not(x & (x - 1))) )
def decimalToBinary(n): return bin(n).replace("0b","")
def ntl(n):return [int(i) for i in str(n)]
def ncr(n,r): return factorial(n)//(factorial(r)*factorial(n-r))

def ceil(x,y):
    if x%y==0:
        return x//y
    else:
        return x//y+1

def powerMod(x,y,p):
    res = 1
    x %= p
    while y > 0:
        if y&1:
            res = (res*x)%p
        y = y>>1
        x = (x*x)%p
    return res

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x
    
def isPrime(n) : # Check Prime Number or not 
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) : 
        if (n % i == 0 or n % (i + 2) == 0) : 
            return False
        i = i + 6
    return True



def read():
    sys.stdin = open('input.txt', 'r')  
    sys.stdout = open('output.txt', 'w') 

def padded_bin_with_complement(x):
    if x < 0:
        return bin((2**16) - abs(x))[2:].zfill(16)
    else:
        return bin(x)[2:].zfill(16)
def binaryToDecimal(binary): 
      
    binary1 = binary 
    decimal, i, n = 0, 0, 0
    while(binary != 0): 
        dec = binary % 10
        decimal = decimal + dec * pow(2, i) 
        binary = binary//10
        i += 1
    print(decimal) 
def CountFrequency(arr): 
    return collections.Counter(arr)

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













    












    
    
       



    






# region fastio
# template taken from https://github.com/cheran-senthil/PyRival/blob/master/templates/template.py

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion


if __name__ == "__main__":
    #read()
    main()
    #dmain()

# Comment Read()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce
from operator import mul


sys.setrecursionlimit(2147483647)
INF = 10 ** 20
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007


k = I()
a, b = LI()
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())
sum=0
for i in range(A,B+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())

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


#print(k)
val = input()

a = int(val.split(" ")[0])
b = int(val.split(" ")[1])
# print(a + "and" + b)

result = 0

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

if result == 0:
    print("NG")
else: print("OK")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# 初めて参照しました。
# ありがとう！

k = int(input())
i = k
#print(k)
mon_str = input()
[a, b] = mon_str.split(" ")
a = int(a)
b = int(b)
#print(a, b)

while i <= b:
    if i >= a and i <= b:
        print("OK")
        exit()
    else:
        i += k

#print(i)
print("NG")

Submission status: Accepted

Solution code:
n = int(input())
b,c=map(int, input().split())
k = b
while  b<= k <= c :
    if k % n == 0 :
        print('OK')
        exit()
    k += 1
print('NG')

Submission status: Accepted

Solution code:
k = int(input());
i= list(map(int,input().split()));

a = int(i[0]);
b = int(i[1]) ;
flag = False;


while(a <= b):
    if a % k == 0:
        flag = True;
        break;
    else:
        a += 1;

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

Submission status: Accepted

Solution code:
k = int(input())
a,b = list(map(int,input().split()))
p = k
check = 0
while True:
    if k >= a and k <= b:
        check = 1
        break
    k += p
    if k > 10000:break

if check == 0:print("NG")
else: print("OK")

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
        break


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k=float(input())

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

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

Submission status: Accepted

Solution code:
K = int(input())

A, B = map(int, input().split())
c = [i for i in range(A, B+1) if i % K == 0]

print('NG' if len(c) == 0 else 'OK')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a, b = map(int, input().split())
rangeint = a // n
if a == rangeint * n or a <= (rangeint + 1) * n <= b:
    print('OK')
else:
    print('NG')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k = int(input())
a, b = map(int, input().split())
count = a
ans = 0
while b > count:
    if count % k == 0:
        print("OK")
        ans = 1
        count = 10000
    else:
        count += 1
if ans == 0:
    if b % k == 0:
        print("OK")
    else:
        print("NG")

Submission status: Accepted

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

limit = int(B / K) + 1
for i in range(limit):
    if A <= K * i and K * i <= B:
        print('OK')
        break
else:
    print('NG')

Submission status: Accepted

Solution code:
K=int(input())
(A,B)=input().split()
(A,B)=(int(A),int(B))
Ans="NG"
for i in range(1000//K+1):
  if A<=i*K<=B:
    Ans="OK"
print(Ans)

Submission status: Accepted

Solution code:
import os
import sys
from collections import deque
from collections import Counter
from heapq import heappop,heappush

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

if __name__ == "__main__":
	main()

Submission status: Accepted

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

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

m(a,b,k)

Submission status: Accepted

Solution code:
k = int(input()) 
a,b= map(int,input().split())
ans = "NG"
L = []
for l in range(1,1001):
    if l%k == 0:
        L.append(l)
for j in range(a,b+1):
    if j in L:
        ans="OK"
print(ans)

Submission status: Accepted

Solution code:
import numpy as np

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

l = np.arange(n,B+1,n)

for i in range(len(l)):
    if A <= l[i] <= B:
        print("OK")
        break
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:
K= int(input())
A,B=map(int,input().split())

s= int(A/K)


if s*K==A:
  print("OK")

elif (s+1)*K>B:
  print("NG")
  
else:
  print("OK")

Submission status: Accepted

Solution code:
K = int(input())
A,B = [int(i) for i in input().split()]
flag=0
for i in range(1,1001):
    if(i*K>=A and i*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())
is_ok = False
for i in range(1,int(b/k)+1):
    if a<=i*k<=b:is_ok=True
    else: pass
print("OK" if is_ok==True else "NG")

Submission status: Accepted

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

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

Submission status: Accepted

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

tmp = A % K
if(tmp == 0): 
	print('OK')
else:
	if(A + (K-tmp) <= B):
		print('OK')
	else:
		print('NG')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k = int(input())
v = list(map(int, input().split()))
c = 0
for i in range(v[0], v[1]+1):
    if i % k == 0:
        c += 1
if c >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")
elif K*(int(A/K)+1) <= B:
    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:
        print("OK")
        count+=1
        break
if count==0:
    print("NG")

Submission status: Accepted

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

for i in range(1, 10001):
    if a <= i * k <= b:
        print('OK')
        exit()
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')
        break
else:
    print('NG')

Submission status: Accepted

Solution code:
n = int(input())
m = list(map(int,input().split()))

sa = m[1] - m[0]
flag = 0
hantei = m[0]

if sa == 0:
    if m[0] % n == 0:
        print("OK")
        exit()
    else:
        print("NG")
        exit()

if hantei % n == 0:
    flag += 1

for x in range(sa):
    hantei = (x + 1) + m[0]
    if hantei % n == 0:
        flag += 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 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()
print("NG")

Submission status: Accepted

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

n=1
while True:
    tmp = k*n

    if a <= tmp <=b:
        print("OK")
        exit()
    elif tmp > b:
        print("NG")
        exit()

    n+=1

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()))
A=A_B[0]
B=A_B[1]
m=1
c=0
for i in range(A,(B+1)):
  if(i%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())
c=1
while(1):
    ans=k*c
    if (a<=ans)and(ans<=b):
        print('OK')
        break
    elif b<ans:
        print('NG')
        break
    c+=1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0

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

for i in range(0,1001,k):
    if a <= i <= b:
        print("OK")
        exit()
print("NG")

Submission status: Accepted

Solution code:
a = int(input())
b,c = (map(int,input().split()))
while b<=c:
    if b%a==0:
        print('OK')
        break
    elif 0==c-b:
        print('NG')
        break
    b+=1

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
  else:
    pass
  

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

Submission status: Accepted

Solution code:
from sys import stdin,stdout
n=int(stdin.readline())
l,r=map(int,stdin.readline().split());f=0
for i in range(l,r+1):
    if i%n==0:
        f=1
        break

ans='OK' if f else 'NG'
stdout.write(ans+' ')