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

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

Submission status: Accepted

Solution code:
K=int(input())
A,B=map(int,input().split())
l=list(i for i in range(A,B+1))
for i in l:
    if i%K==0:
        print("OK")
        exit()
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:
    print('OK')
    flag=1
    break
if flag==0:
	print('NG')

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())
flag = 0

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

if flag==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 = 1
        break
if flag == 0:
    print("NG")
if flag == 1:
    print("OK")

Submission status: Accepted

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

for i in range(b + 1):
    if i*n >= a and i*n <= b:
        print("OK")
        break
    elif i*n > b:
        print("NG")
        break

Submission status: Accepted

Solution code:

def resolve():
    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")

if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
#input()
K=int(input())
A,B=map(int,input().split())
#list(map(int,input().split()))
#[input() for i in range(N)]

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

a = A % K
x = K - a
b = B - A

if A % K == 0:
    ans = 'OK'
else:
    if b >= x:
        ans = 'OK'
    else:
        ans = 'NG'

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
K=int(input())
A,B=map(int,input().split())
i=1
ans=0
while B>=K*i:
    if A<=K*i:
        ans=1
        break
    i=i+1
if ans==1:
    print("OK")
else:
    print("NG")

Submission status: Accepted

Solution code:
k=int(input())
a,b=map(int,input().split(' '))
x=b//k
y=k*x
if y>=a:
    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:
K = int(input())
A, B = map(int,input().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#dt = {} for i in x: dt[i] = dt.get(i,0)+1
#dt = {k:v for k,v in sorted(x.items(), key=lambda i: i[1])}
ipnl = lambda n: [int(input()) for _ in range(n)]
inp = lambda :int(input())
ip = lambda :[int(w) for w in input().split()]
mp = lambda :map(int,input().split())

k = inp()
a,b = mp()
#print(a//k , a//k)
if a%k == 0 or b%k == 0 or b//k - a//k > 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:
k = int(input())
a,b = map(int, input().split())
num = a // k
if a % k == 0:
    print("OK")
else:
    if k*(num+1) <= b:
        print("OK")
    else:
        print("NG")

Submission status: Accepted

Solution code:
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

K = INT()
A, B = MAP()

ans = False
i = 1
while i <= B:
    if A <= K*i <= B:
        ans = True
        break
    i += 1 

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

Submission status: Accepted

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

now = 1
ans = "NG"

while now * k <= b:
  if a <= now * k <= b:
    ans = "OK"
    break
  else:
    now += 1
    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

kotae = False

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

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

Submission status: Accepted

Solution code:
import sys
k=int(input())
a,b=map(int,input().split())
c=0
while c<=b:
    if c>=a:
        print("OK")
        sys.exit()
    c += k
print("NG")

Submission status: Accepted

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

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

Submission status: Accepted

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

l=a//n
r=b//n
if l!=r:
	print("OK")
else:
	if a%n==0 or b%n==0:
		print("OK")
	else:
		print("NG")

Submission status: Accepted

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

if (b//n) >= 1 and ((b//n) > (a//n)):
  print("OK")
elif a%n == 0 or b%n == 0:
  print("OK")
else:
  print("NG")

Submission status: Accepted

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

Submission status: Accepted

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

t1 = A // K
t2 = B // K

if t1 < t2 or A % K == 0:
    print("OK")
else:
    print("NG")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from io import StringIO
import unittest

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

    aa = 0
    while aa <= b:
        aa += k

        if a <= aa <= b:
            print("OK")
            return

    print("NG")
    return

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """7
500 600"""
        output = """OK"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """4
5 7"""
        output = """NG"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """1
11 11"""
        output = """OK"""
        self.assertIO(input, output)

if __name__ == "__main__":
    # unittest.main()
    resolve()

Submission status: Accepted

Solution code:
K = int(input())

A, B = map(int, input().split())
if (A - 1) // K < B // K:
    print("OK")
else:
    print("NG")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from math import floor
import sys
input = sys.stdin.readline
K=int(input().rstrip('\n'))
A,B = (int(x) for x in input().rstrip('\n').split())
if floor(A/K)<floor(B/K) 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
    if i == b:
        print('NG')

Submission status: Accepted

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

if A % K == 0:
    ans = "OK"
elif (A // K + 1) * K <= B:
    ans = "OK"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int,input().split()))
l2 = [i for i in range(l[0],l[1]+1)]
l3 = list(filter(lambda x: x%n ==0,l2))
if l3:
    print("OK")
else:
    print("NG")

Submission status: Accepted

Solution code:
n=int(input())

x,y = map(int,input().split())

for i in range(x,y+1):
    if i%n == 0:
        print('OK')
        exit()
print('NG')

Submission status: Accepted

Solution code:
import sys

K = int(input())
A, B = [int(n) for n in input().split()]

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

Submission status: Accepted

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

ok = False

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

if not ok:
	print("NG")

Submission status: Accepted

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

num = a//k 
if k*num == a:
    print('OK')
    quit()
elif k*(num+1) <= b:
    print('OK')
    quit()
else:
    print('NG')

Submission status: Accepted

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

dif = b-a
if b-a >= k:
    result = True
else:
    for i in range(a, b+1):
        if i % k == 0:
            result = True

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

flg = 0
for i in range(1,1002):
  if k*i >=a and k*i <=b:
    flg = 1
    break

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

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 a//k==b//k:

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

Submission status: Accepted

Solution code:
K = int(input())

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


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

if flg:
    print('OK')
else:
    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"
        break
    
print(result)

Submission status: Accepted

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

if ( (a-1) // K - b // K) < 0:
    print("OK")
else:
    print("NG")

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    K = int(input())
    A, B = map(int, input().split())

    for i in range(A, B + 1):
        if not i % K:
            print('OK')
            return
    print('NG')


main()

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
 
print("OK") if flag else 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
        break
if ans > 0:
    print("OK")
else:
    print("NG")

Submission status: Accepted

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

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

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

Submission status: Accepted

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

start = (A // K) * K
while True:
    if A <= start <= B:
        print('OK')
        exit()
    start += K

    if start > B:
        break

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 = '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())
if (A//K != B//K) or (A//K * K == A) or (B//K * K == 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')
        break
else:
    print('NG')

Submission status: Accepted

Solution code:
k = int(input())
n,l=map(int,input().split())
N = n
s=0
while N <= l:
  if N%k ==0 :
    s += 1
  N += 1
if s >=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(0, b + 1, k):
    if a <= i:
        ans = 'OK'
        break

print(ans)

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:
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:
#A
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())

is_multiple = False

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

a_ = a // k
b_ = b // k
if b_ > a_:
    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 = list(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())

n = k*(b//k)
if a <= n and n <= b:
    print("OK")
else:
    print("NG")

Submission status: Accepted

Solution code:
k = int(input())
a, b = map(int, input().split())
s=0
for i in range(1001):
	if b>=k*i>=a:
		print('OK')
		s+=1
		break

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

Submission status: Accepted

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

r=a%k
if r==0:
  print('OK')
elif b-a+r>=k:
  print('OK')
else:
  print('NG')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#A
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:
def a165(k, a, b):

    ans = "NG"
    count = k
    while count <= 1100:
        if a <= count <= b:
            ans = "OK"
            break
        else:
            count += k

    return ans
def main():
    k = int(input())
    a, b = map(int, input().split())
    print(a165(k, a, b))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
K = int(input())
A,B = map(int,input().split())
nK = K
while(nK<=1000):
    if(A<=nK<=B):
        print("OK")
        exit()
    nK += K
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 == 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 float(i)%K==0:
        ans='OK'

print(ans)

Submission status: Accepted

Solution code:


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

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())
n=0
result=0
while k*n<b:
    n=n+1
    if k*n>=a and k*n<=b:
        result=1
if result==1:
    print("OK")
else:
    print("NG")

Submission status: Accepted

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

if A//K < B//K:
    print("OK")
    exit()

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

Submission status: Accepted

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

aa = a//k
bb = b//k
# print(aa, bb, a%k, b%k)

if a%k == 0 or b%k == 0:
    print("OK")
elif aa == bb:
    print("NG")
else:
    print("OK")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
k= int(input())
a,b=map(int,input().split())
print("OK" if math.ceil(a/k)<=math.floor(b/k) else "NG")

Submission status: Accepted

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

    n = a
    i = 1
    while n <= c:
        n = a* i
        if n>=b and n <= c:
            print('OK')
            return
        i+=1
    print('NG')
if __name__=='__main__':
    main()

Submission status: Accepted

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

#print(k,a,b)

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

if flug==0:
    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'

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

print(ans)

Submission status: Accepted

Solution code:
K = int( input().strip() )  
A , B   = map ( int , input().strip().split(" ") ) ;
X = B // K ;
print ( "OK" if X * K >= A else "NG"  ) ;

Submission status: Accepted

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

Submission status: Accepted

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

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

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:
# coding=UTF-8
from collections import deque
from operator import itemgetter
from bisect import bisect_left, bisect
import itertools
import sys
import math
import numpy as np
import time
sys.setrecursionlimit(10**6)
input = sys.stdin.readline


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


if __name__ == '__main__':
    main()

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=ans*0
print(["OK","NG"][ans])

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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


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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from collections import *
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())
ab = list(map(int,input().split()))

f = False
i = ab[0]
while i <= ab[1]:
    if i % k == 0:
        print("OK")
        f = True
        break
    i += 1

if f is False:
    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())
print("OK" if B-A >= B%K else "NG")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k = int(input())
a,b = map(int,input().split())
i = a
while True:
    if i > b :
        print('NG')
        break
    elif i% k == 0:
        print('OK')
        break
    elif i % k != 0:
        i += 1

Submission status: Accepted

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

    a = A // K
    a_mod = A % K
    if(a_mod == 0):
        print("OK")
    else:
        dist = K * (a+1)
        if(dist >= A and dist<= B):
            print("OK")
        else:
            print("NG")

main()

Submission status: Accepted

Solution code:
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
#      .      '                    Udit Gupta @luctivud         ,              
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                            ##     ##  #######  # #  ######
                            ##     ##  ##   ##  ###    ##
                            ##     ##  ##    #  # #    ##
                            #########  #######  # #    ##
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

import sys
import math as mt
# sys.setrecursionlimit(10**6)

def get_ints(): return map(int, sys.stdin.readline().strip().split())
def get_array(): return list(map(int, sys.stdin.readline().strip().split()))

def printwsp(*args): return print(*args, end="")
def printsp(*args): return print(*args, end=" ")
def printchk(*args): return print(*args, end="tst, ")

MOD = int(1e9+7); BABYMOD = 998244353;
# ################################ HELPER PROGRAMS USED ###################################
# ################################## MAIN STARTS HERE #####################################
# for _testcases_ in range(int(input())):
k = int(input())
a, b = get_ints()
boo = False
if a%k == 0:
    boo = True
elif b%k == 0:
    boo = True
else:
    start = a // k
    end = b // k
    if start != end:
        boo = True
if boo:
    print("OK")
else:
    print("NG")


# #########################################################################################
'''
THE LOGIC AND APPROACH WAS DEVELOPED BY ME @luctivud.
SOME PARTS OF THE CODE HAS BEEN TAKEN FROM WEBSITES LIKE::
(I Own the code if no link is provided here or I may have missed mentioning it)
PLEASE DO NOT PLAGIARISE.
'''

Submission status: Accepted

Solution code:
import bisect,sys
import math
from collections import deque

def sRaw():
    return input().rstrip("\r")


def iRaw():
    return int(input())


def ssRaw():
    return input().split()


def isRaw():
    return list(map(int, ssRaw()))

INF = 1 << 29

DIV = (10**9) + 7

def mod_inv_prime(a, mod=DIV):
    return pow(a, mod-2, mod)


def mod_inv(a, b):
    r = a
    w = b
    u = 1
    v = 0
    while w != 0:
        t = r//w
        r -= t*w
        r, w = w, r
        u -= t*v
        u, v = v, u
    return (u % b+b) % b


def CONV_TBL(max, mod=DIV):
    fac, finv, inv = [0]*max, [0]*max, [0]*max
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, max):
        fac[i] = fac[i-1]*i % mod
        inv[i] = mod - inv[mod % i] * (mod//i) % mod
        finv[i] = finv[i-1]*inv[i] % mod

    class CONV:
        def __init__(self):
            self.fac =fac
            self.finv = finv
            pass

        def ncr(self, n, k):
            if(n < k):
                return 0
            if(n < 0 or k < 0):
                return 0
            return fac[n]*(finv[k]*finv[n-k] % DIV) % DIV
        
    return CONV()



sys.setrecursionlimit(200005)


def main():
    K = iRaw()
    A,B = isRaw()
    div = A//K
    if A%K !=0:
        div+=1
    ans = "OK" if (div*K) <= B else "NG"
    return ans

if __name__ == "__main__":
    print(main())

Submission status: Accepted

Solution code:


def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def solve():
    K = read_int()
    A, B = read_ints()
    a = A//K
    if a*K == A or (a+1)*K <= B:
        return 'OK'
    return 'NG'


if __name__ == '__main__':
    print(solve())

Submission status: Accepted

Solution code:
K = int(input())
A, B = list(map(int, input().split()))
s = A // K
ret = 'OK' if (A <= s * K <= B) or (A <= (s+1)*K <= B) else 'NG'
print(ret)

Submission status: Accepted

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

flag = 0

for cnt in range(AB[0],AB[1]+1):
    if (cnt % K == 0):
        flag = 1
        break
        


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

Submission status: Accepted

Solution code:
k = int(input())
a,b = map(int, input().split())
for i in range(1000):
    tmp = k*i
    if a <= tmp and b >= tmp:
        print("OK")
        break
    if b < tmp:
        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')
        exit()
print('NG')

Submission status: Accepted

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

flag = 0
for i in range(a,b+1):
    if(i%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 a%k == 0 or b%k == 0:
  print("OK")
elif a//k == b//k:
  print("NG")
else:
  print("OK")

Submission status: Accepted

Solution code:
k = int(input())

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

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


if ans == 1:
    print("OK")
else:
    print("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")
else:
    if A // K == B // K:
        print("NG")
    else:
        print("OK")