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())
n = 0
for i in range(a, b+1):
    if i % k ==0:
        n += 1
if n > 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())

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

Submission status: Accepted

Solution code:
n,a,b=map(int,open(0).read().split())

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

Submission status: Accepted

Solution code:
import sys

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

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

Submission status: Accepted

Solution code:
k= int(input())
x,y = map(int,input().split())
if 1<=x<=y<=1000 and 1<=k<=1000:
    pass



    if x%k>>0 :
        if x<= (x//k+1)*k <=y :
            print('OK')
        else:
            print('NG')
    else:
        print('OK')

else:
    print('NG')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K = int(input())

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

Submission status: Accepted

Solution code:
import numpy as np
s= int(input())
List = list(map(int, input().split()))
array = list()
for i in range(List[0],List[1]+1):
    if s == 1:
        array.append("OK")
        break
    if i % s == 0:
        array.append("OK")
        break
if ('OK' in array):
    print("OK")
else:
    print("NG")

Submission status: Accepted

Solution code:
K = input().strip()
K_int = int(K)

A, B = input().strip().split(" ")
A_int = int(A)
B_int = int(B)

possible = False

for i in range(A_int, B_int + 1):
    if i % K_int == 0:
        possible = True
        break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections

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

X = []

for i in range(B - A + 1):
    m = A + i
    n = m % K

    X.append(n)

dict = collections.Counter(X)
l = dict[0]

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(300000)

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')


K = I()
A, B = MI()

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

Submission status: Accepted

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

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

for cnt in range(int(b)):
    if cnt+1 >= int(a):
       # print(cnt+1,int(k),int(cnt+1) % int(k))

        if int(cnt+1)% int(k) == 0 or int(k) == 1:
            print("OK")
            exit()
print("NG")

Submission status: Accepted

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

K = int(readline())
A, B = map(int, readline().split())
ans = 'NG'
for x in range(A, B+1):
    if x%K == 0:
        ans = 'OK'
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

ans = 'NG'

h = b-a+1

for i in range(h):
    p = a + i
    if p % k == 0:
        ans = 'OK'

print(ans)

Submission status: Accepted

Solution code:
import numpy as np
a = int(input())
b,c=map(int,input().split())
d = np.arange(a,1001,a)
f = np.arange(b,c+1)
d_set=set(d)
f_set=set(f)
#dとfに共通するものを抽出
g_set=d_set&f_set 
#結果をlistに変換
g=list(g_set)
if len(g) == 0:
    print('NG')
else:
    print('OK')

Submission status: Accepted

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

ans = "NG"
if k == 1:
    ans = "OK"
elif k >1000:
    ans = "NG"
else:
    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())
count =0
for Num in range(A,B+1):
    if Num%K ==0:
        count+=1
if count !=0:
    print("OK")
else:
    print("NG")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
K = int(input())
A, B = [int(n) for n in 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())
def ok_ng():
    for i in range(a, b+1):
        if i % k == 0:
            return "OK"
    else:
        return "NG"
print(ok_ng())

Submission status: Accepted

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

for i in range(1, 1001):
    if a <= i * k <= b:
        cnt += 1

print("OK" if cnt > 0 else "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())
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:
k = int(input())
n = list(map(int,input().split()))
a = n[0]
b = n[1]

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

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

Submission status: Accepted

Solution code:
def tom(x, y, k):
  n = x
  while n >= x and n <= b:
    if n % k == 0:
      return 'OK'
    n += 1
  return 'NG'
k = int(input())
a, b = map(int, input().split())
result = tom(a, b, k)
print(result)

Submission status: Accepted

Solution code:
k = int(input())
num = list(map(int, input().split()))
A,B = num[0],num[1]
for i in range(1,1000):
    if A <= k*i <= B:
        print("OK")
        break
    elif B < k*i:
        print("NG")
        break

Submission status: Accepted

Solution code:
import sys
K = int(sys.stdin.readline())
A, B = map(int, sys.stdin.readline().split())
print("OK" if (A <= (B // K) * K) 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')
        exit()
print('NG')

Submission status: Accepted

Solution code:
K=int(input())
A,B=map(int,input().split())
C=B-A
if C>=K-1:
    print("OK")
elif A%K==0:
    print("OK")
elif 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())
b = False
bai = K
counter = 1
while bai <= B:
    if A <= bai <= B:
        b = True
        break
    counter += 1
    bai = K*counter
if b:
    print("OK")
else:
    print("NG")

Submission status: Accepted

Solution code:
import sys
# input
k = int(input())
a, b = map(int, input().split())
#print(f"k >>{k}, a >>{a}, b >>{b}")


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

print("NG")

Submission status: Accepted

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

if a == b:
    if a % n == 0:
        print('OK')
    else:
        print('NG')
elif a % n == 0:
    print('OK')
else:
    while a < b:
        a += 1
        if a % n == 0:
            print('OK')
            break
        elif a == b:
            print("NG")

Submission status: Accepted

Solution code:
a=int(input())
b,c=input().split()
d=0
while True:
    if (int(b))<=(a*d)<=(int(c)):
        print("OK")
        break
    elif (int(c))<(a*d):
        print("NG")
        break
    d+=1

Submission status: Accepted

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

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

Submission status: Accepted

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

A_d = A//K
B_d = B//K

if (B_d-1)*K >= A or (A_d+1)*K <= B or A%K == 0 or B%K == 0:
    print("OK")

else:
    print("NG")

Submission status: Accepted

Solution code:
K = int(input())
A, B = map(int,input().split())
number = A
count = 0
while(1):
 if(number%K == 0):
  count +=1
 number += 1  
 if(number > B):
  if(count >0):
    print("OK")
  else:
    print("NG")
  break;

Submission status: Accepted

Solution code:
a = int(input())
b = input().split()
b[0] = int(b[0])
b[1] = int(b[1])
A = b[0] / a
B = b[1] / a
C = B - A
if a == 1:
    print('OK')
elif b[1]%a == 0:
    print('OK')
elif b[0]%a == 0:
    print('OK')
elif C >= 1:
    print('OK')
elif (b[1]//a)*a >= b[0]:
    print('OK')
else:
    print('NG')

Submission status: Accepted

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

is_ok = 0

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

Submission status: Accepted

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

if k == a:
    flag = 1
elif k < a:
    if a % k == 0 :
        flag = 1
    elif (int(a / k)+1) * k <= b:
        flag = 1
elif a < k:
    if k <= b:
        flag = 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K=int(input())
A,B=map(int,input().split())
i=1
ok=0
while i*K <= B and ok!=1:
    if A <= i*K <= B:
        print("OK")
        ok=1
    i=i+1
if ok!=1:
    print("NG")

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k=int(input())
a,b=map(int,input().split())
aa=a//k
bb=b//k
ax=a%k
bx=b%k
if (aa==bb and (ax==0 or bx==0)) or aa!=bb or k==1:
	print("OK")
else:
	print("NG")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# 整数の入力
K = int(input())
# スペース区切りの整数の入力
A, B = map(int, input().split())


#出力　#自力
if A%K != 0:
  if A-(A%K)+K <= B:
    print("OK")
  else:
    print("NG")
else:
    print("OK")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K = int(input())

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

b = B % K
w = B - A

if w - b >= 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')
        exit(0)

print('NG')

Submission status: Accepted

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

flag = False
for i in range(K, 1001, K):
    if A <= i <= B:
        flag = True
        break

if flag:
    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
  else:
    count+=0

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

Submission status: Accepted

Solution code:
N = int(input())
A,B = list(map(int, input().split()))
takahashi = list(range(A, B+1))
d_list=[]
for i in takahashi :
    if i % N == 0:
        d_list.append(1)
    else:
        d_list.append(0)
if 1 in d_list:
    print("OK")
else:
    print("NG")

Submission status: Accepted

Solution code:

def main():
    K = int(input())
    A, B = map(int, input().split())
    m = B // K
    out = 'NG'
    for i in range(1, m+1):
        ans = i * K
        if A <= ans <= B:
            out = 'OK'
    print(out)
main()

Submission status: Accepted

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

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())
list = input().split()

if int(list[0])//k != int(list[1])//k:
  print("OK")
elif int(list[0])%k == 0:
  print("OK")
else:
  print("NG")

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

i=A
length = B-A+1
judge = 0

for _ in range(length):
    if(i%K==0):
        judge = 1
        break

    i += 1
    
if judge==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' )
        quit()
else:
    print( 'NG' )

Submission status: Accepted

Solution code:
n=int(input())
a,b=map(int,input().split())
l=[abb for abb in range(a, b+1)]
kl=[]
for am in l:
    if am%n==0:
        kl.append(am)
if len(kl)>0:
    print("OK")
else:
    print("NG")

Submission status: Accepted

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


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

Submission status: Accepted

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

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

Submission status: Accepted

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

o = (((m+(k-m%k))/k)-1)*k

if (l <= o <= m):
    print("OK")
else:
    print("NG")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))

#################

K = I()
A,B = LI()

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())
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())
AB = input()
ABB = AB.split()
A = int(ABB[0])
B = int(ABB[1])
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())

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

Submission status: Accepted

Solution code:
K = int(input())
A, B = map(int, input().split())
k = 0
while k <= B:
    if A <= k <= B:
        print('OK')
        exit()
    k += K
print('NG')

Submission status: Accepted

Solution code:
K = int(input())
A, B = map(int, input().split())
List = []
x = 0
cnt = 1
state = 0
for n in range((B-A)+1):
    List.append(A + n)

for i in range(len(List)):
    if List[i]%K == 0:
        print('OK')
        state = 1
        break

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

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

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

Submission status: Accepted

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


ps = int(A / K)
pa = A % K
qs = int(B / K)
qa = B % K

if A==B:
	if pa==0:
		print("OK")
	else:
		print("NG")
else:
	if qs-ps>0:
		print("OK")
	else:
		if pa==0 or qa ==0:
			print("OK")
		else:
			print("NG")

Submission status: Accepted

Solution code:
inp = [input() for i in range(2)]
uu = int(float(inp[0]))
K = int(uu)
A,B = inp[1].split()
A,B = int(float(A)),int(float(B))
c,bbb = 0,0
if 1<= A <= B <= 1000 and 1<= K <= 1000:
  for h in range(A,B,1):
    c = h % K
    if c == 0:
      bbb += 1
  if bbb > 0:
    print('OK')
  elif K == 1:
    print('OK')
  elif K ==A or K ==B:
    print('OK')
  elif A % K == 0 or B % K == 0:
    print('OK')
  else:
    print('NG')

Submission status: Accepted

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

for i in range(1000):
    if a<= k*i <=b :
        print("OK")
        exit()
print("NG")

Submission status: Accepted

Solution code:
times = int(input())
range_distance=input().split()
ini=int(range_distance[0])
end=int(range_distance[1])

dev = end - ini 
num = 0
cnt=0

for i in range(dev+1):
    num = ini + i
    if num % times ==0:
        cnt +=1
        break

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K = int(input())

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

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

Submission status: Accepted

Solution code:
def iin(): return int(input())
def iln(): return list(map(int, input().split()))

K = iin()
A, B = iln()

curr_num = A
while curr_num % K != 0:
    curr_num += 1

if A <= curr_num <= B:
    print("OK")
else:
    print("NG")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = int(input())
B, C = map(int,input().split())
flag = 1

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

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

Submission status: Accepted

Solution code:
import math
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))
mod = 10**9 + 7 
sys.setrecursionlimit(1000010)


K = ni()
A,B = nm()
if A % K == 0:
    print('OK')
    exit(0)
if B // K != A //K :
    print('OK')
    exit(0)
print('NG')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

ans="NG"

for i in range(1,1000):
    if K*i >= A and K*i <= B: 
        ans="OK"
        break

print(ans)

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==0:
  print("NG")
else:
  print("OK")

Submission status: Accepted

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

Submission status: Accepted

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

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
    
if flg:
  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')
elif b-a < k and a%k <= b%k:
    print('NG')
else:
    print('OK')

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(i) for i in input().split()]

min_multi = int((A / K) + 1)
noKiri = K * min_multi
Kiri = K * ( min_multi - 1 )
if ( A <= noKiri <= B ) or (A <= Kiri <= B) :
  print('OK')
else :
  print('NG')

Submission status: Accepted

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

if k == 1 :
    print('OK')
    exit(0)
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(" "))
n = int(A/K)
m = int(B/K)
if K ==1:
  print("OK")
else:
  if n == m and n == A/K:
    print('OK')
  elif n == m:
    print('NG')
  else:
    print('OK')

Submission status: Accepted

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

q1, mod1 = divmod(A, K)
q2, mod2 = divmod(B, K)

if mod1 == 0:
    print("OK")
elif mod2 == 0:
    print("OK")
elif A + K - mod1 <= B:
    print("OK")
else:
    print("NG")

Submission status: Accepted

Solution code:
k = int(input())
a, b = map(int, input().split())
while a%k != 0:
    a = a+1

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

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
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 = list(map(int, input().strip().split()))

k = (A+(K-1))//K

if K*k <= B:
	print('OK')
else:
	print('NG')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-


import math

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

j_a = math.floor(float(A)/float(K))
j_b = math.floor(float(B)/float(K))

if(float(A)%float(K) ==0):
    print('OK')
elif(float(B)%float(K) ==0):
    print('OK')
elif(j_b-j_a >= 1):
    print('OK')
    
else:
    print('NG')

Submission status: Accepted

Solution code:
k = int(input())
x = input().split()
a = int(x[0])
b = int(x[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:
n=int(input())
a,b=map(int,input().split())
z=1
for i in range(a,b+1):
    if i%n==0:
        z=0
        print('OK')
        break
if z: print('NG')

Submission status: Accepted

Solution code:


############ ---- USER DEFINED INPUT FUNCTIONS ---- ############
def inp():
    return(int(input().rstrip()))
def inlt():
    return(list(map(int,input().rstrip().split())))
def insr():
    s = input().rstrip()
    return(s[:len(s) - 1])
def invr():
    return(map(int,input().rstrip().split()))
################################################################
k = inp()
a,b = invr()

for i in range(a,b + 1):
    if i%k == 0:
        has = True
        break
else:
    has = False
if has:
    print('OK')
else:
    print('NG')
#print('Yes' if '7' in n else 'No')
#print('No')
#print()

Submission status: Accepted

Solution code:
K = int(input())
A,B = map(int, input().split())
import  math
C = math.ceil(A/K)
if C*K <=B:
    print("OK")
else:
    print("NG")

Submission status: Accepted

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

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:
n = int(input())
a, b = map(int, input().split())
k = 1
while True:
    if a <= n*k <= b:
        print("OK")
        exit()
    elif n*k > b:
        print("NG")
        exit()
    else:
        k += 1

Submission status: Accepted

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

N = A // K

flag = False
for i in range(N, N+1000):
    v = K * i
    if (A <= v) and (v <= B):
        print("OK")
        flag = True
        break
        
if not flag:
    print("NG")

Submission status: Accepted

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

if a==1:
    print('OK')
else:
    c=0
    b=m-n
    for i in range(b+1):
        if (m-i)%a==0:
            c+=1
            break

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

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:
		print('OK')
		x+=1
		break

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K=int(input())
A,B=map(int,input().split())
if A%K==0:
  print('OK')
else:
  c=K*(A//K+1)
  if c<=B:
    print('OK')
  else:
    print('NG')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
  k = int(input())
  a, b = map(int,input().split())
  if a%k==0 or b%k==0 or b-a >= abs(k-a%k):
    print('OK')
  else:
    print('NG')

if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
K=int(input())
A,B=map(int, input().split())
ans = 'NG'
for i in range(1, B//K+1):
  if K*i>=A and K*i<=B:
    ans = 'OK'
    break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

ans=0

for i in range(int(a/k-1),math.ceil((b/k)+1)):
  if(k*i>=a):
    if(k*i<=b):
      ans=1
      break
if(k==1):
  ans=1

if(ans==0):
  print("NG")
if(ans==1):
  print("OK")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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