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:
# A
import math

inp = input()
K = int(inp)


inp = input().split(' ')
A, B = int(inp[0]), int(inp[1])

A_ceil = math.ceil(A/K)*K
if A_ceil <= B:
    print('OK')
else:
    print('NG')

Submission status: Accepted

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

a = A//K
b = B//K

flag = 0

for i in range(a,b+1):
    N = K*i
    if A<= N <= B:
        flag = 1
        print("OK")
        break

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

Submission status: Accepted

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

OK=False
for n in range(A,B+1):
    if n%K==0:
        OK=True
        break

if OK:
    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):
    sTgt=i
    if(i%K==0):
      print('OK')
      break
    elif(i==B):
      print('NG')
  
if __name__=='__main__':
  main()

Submission status: Accepted

Solution code:
"""
    This template is made by Satwik_Tiwari.
    python programmers can use this template :)) .
"""

#===============================================================================================
#importing some useful libraries.

import sys
import bisect
import heapq
from math import *
from collections import Counter as counter  # Counter(list)  return a dict with {key: count}
from itertools import combinations as comb # if a = [1,2,3] then print(list(comb(a,2))) -----> [(1, 2), (1, 3), (2, 3)]
from itertools import permutations as permutate
from bisect import bisect_left as bl #
from bisect import bisect_right as br
from bisect import bisect

#===============================================================================================
#some shortcuts

mod = pow(10, 9) + 7
def inp(): return sys.stdin.readline().strip() #for fast input
def out(var): sys.stdout.write(str(var))  #for fast output, always take string
def lis(): return list(map(int, inp().split()))
def stringlis(): return list(map(str, inp().split()))
def sep(): return map(int, inp().split())
def strsep(): return map(str, inp().split())
def graph(vertex): return [[] for i in range(0,vertex+1)]
def zerolist(n): return [0]*n
def nextline(): out("\n")  #as stdout.write always print sring.
def testcase(t):
    for p in range(t):
        solve()
def printlist(a) :
    for p in range(0,len(a)):
        out(str(a[p]) + ' ')
def lcm(a,b): return (a*b)//gcd(a,b)


#===============================================================================================
# code here ;))

def solve():
    k = int(inp())
    a,b = sep()
    if (b//k) - (a//k) > 0:
        print('OK')
    else:
        if(k == 1):
            print('OK')
        else:
            if(a%k == 0 or b%k==0):
                print('OK')
            else:
                print('NG')



testcase(1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K = int(input())
A, B = (int(_) for _ in input().split())
b = B//K
a = (A-1)//K
if b - a >= 1:
  print('OK')
else:
  print('NG')

Submission status: Accepted

Solution code:
import sys


sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


def input():
    return sys.stdin.readline().strip()


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


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

Submission status: Accepted

Solution code:
k = int(input())

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

#print(a)
flag = 0
for x in range(a,b+1):
    if(x%k == 0):
        flag = 1

if(flag == 1):
    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(1, 1000):
    if A <= K * i <= B:
        flag = True

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
K = int(input())
A, B = list(map(int, input().split()))
tmp = 0
while(True):
  tmp += K
  if A<= tmp <=B:
    print("OK")
    break
  elif tmp > B:
    print("NG")
    break

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

res = False
for i in range(1000):
    k = i * K
    if k >= A and k <= B:
        res = True

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
k=int(input())
a,b=map(int,input().split())
val=b//k
if val*k in range(a,b+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")
        exit()

print("NG")

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
import sys
import math

# A, B, C = [int(x) for x in stdin.readline().rstrip().split()]
# A, B = [int(x) for x in stdin.readline().rstrip().split()]
# U = input().split()
K = int(input())

A, B = [int(x) for x in stdin.readline().rstrip().split()]
for i in range(A,B+1):
    if i%K==0:
        print("OK")
        sys.exit()
print("NG")
# A, B = [str(x) for x in stdin.readline().rstrip().split()]

# print("YES")
# print("NO")

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

Submission status: Accepted

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

ans = b // k * k
#print(ans)
if ans >= a:
    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
        break

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
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())
ans = "NG"
for i in range(a , b+1):
    if i % k == 0:
        ans = "OK"
        break
print(ans)

Submission status: Accepted

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

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

print("NG")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys

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

P = 0
while True:
    if A <= P <= B:
        print("OK")
        sys.exit()
    elif B < P:
        print("NG")
        sys.exit()

    P += K

Submission status: Accepted

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

Submission status: Accepted

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

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

print(res)

Submission status: Accepted

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

cur = K

while True:
  if A <= cur <= B:
    print("OK")
    break
  elif cur > B:
    print("NG")
    break
  else:
    cur += K

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

ka = a//k
kb = b//k

if a % k ==0:
    print("OK")
    exit()
elif b % k ==0:
    print("OK")
    exit()
elif kb -ka >0:
    print("OK")
    exit()
else:
    print("NG")

Submission status: Accepted

Solution code:
def q1():
    k = int(input())
    a, b = [int(i) for i in input().split(" ")]
    for i in range(a, b + 1):
        if i % k == 0:
            print("OK")
            return
    print("NG")

q1()

Submission status: Accepted

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

ans = K * (A//K)
ans2 = ans + K

if (A <= ans <= B) or (A <= ans2 <= B):
    print('OK')
else:
    print('NG')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K = int(input())
A, B = map(int, input().split())
count = 1
check = 0
flag = False
while check < B:
    check = K * count
    if A <= check and check <= B:
        flag = True
    count += 1

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

Submission status: Accepted

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

i = int(A/K)*K
if i<A:
    i += K

if B>=i:
    print('OK')
else:
    print('NG')

Submission status: Accepted

Solution code:
n=int(input())

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

print('NG')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k=int(input())
l,r=[int(x) for x in input().split()]
if l//k == r//k and l%k!=0 and r%k!=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 i%K == 0:
    print('OK')
    exit()
print('NG')

Submission status: Accepted

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

print(result)

Submission status: Accepted

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

    for i in range(10000):
        if a <= k*i and k*i <= b:
            return 'OK'
        elif b <= k*i:
            return 'NG'


print(solve())

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

l=[]
x=0
for i in range(a,b+1):
    l.append(i)
for i in l:
    if i%k==0:
        x+=1
if x==0:
    print("NG")
else:
    print("OK")

Submission status: Accepted

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

ans='NG'
i=1
while i*K<=1000:
    if A<=i*K<=B:
        ans='OK'
    i+=1

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
k = int(input())
a,b = [int(i) for i in input().split()]
end_flag = False
for i in range(a,b+1):
    if i % k == 0 and i //k >= 1:
        end_flag = True
        break
print('OK' if end_flag else '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
        break
if(flag):
    print('OK')
else:
    print('NG')

Submission status: Accepted

Solution code:
def main():
  k = int(input())
  #s = input()
  #s = input().split()
  a,b = list(map(int,input().split()))
  #a = [input() for i in range(n)]
  #a = [int(input()) for i in range(n)]
  #a = [input().split() for i in range(n)]
  #a = [list(map(int,input().split())) for i in range(n)]
  ans = 0
  count = 0
  lis = []
  
  for i in range(a,b+1):
    if i % k == 0:
      print("OK")
      exit()
  print("NG")

if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
def resolve():
    # 整数 1 つ
    k = int(input())
    # 整数複数個
    A, B = list(map(int, input().split()))
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

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

    if r ==False:
        print("NG")

    #print("n")


resolve()

Submission status: Accepted

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

ans = 'NG'
if a%k == 0 or b%k ==0:
    ans = 'OK'
if a//k < b//k:
    ans = 'OK'

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a = int(input())
q, w = map(int, input().split())
ans = False
for i in range(1000):
    if a * i >= q and a * i <= w:
        ans = True

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

Submission status: Accepted

Solution code:
import random
import math
LI = lambda: list(map(int,input().split()))
MI = lambda: map(int,input().split())
yes = lambda: print("Yes")
no = lambda: print("No")
I = lambda: list(input())
J = lambda x: "".join(x)
II = lambda: int(input())
SI = lambda: input()
#---khan17---template
t = II()
a,b = MI()
boo = False
for i in range(a,b+1):
	if i%t == 0:
		boo = True
		break
print("OK" if boo else "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
    
if ans == 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 i%k==0:
        print('OK')
        exit()
else:
    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>0:
    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//k - a//k > 0):
    print("OK")
else:
    print("NG")

Submission status: Accepted

Solution code:
k = int(input())
ab = [int(i) for i in input().split()]

a = ab[0]
b = ab[1]

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
k = int(input())
a, b = map(int, input().split())
tmp = 0
for i in range(a, b+1):
    if i % k == 0:
        tmp = 1
if tmp:
    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())

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

print("NG")

Submission status: Accepted

Solution code:
c=int(input())
a,b=map(int,input().split())
st="n"
for i in range(a,b+1):

    if i%c==0:
        st="Q"
        print("OK")
        break
if st=="n":
    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
    break
if(c==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")
    exit()
print("NG")

Submission status: Accepted

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

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

if flag:
    print("NG")

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())  #数字

if K == 1:
    print("OK")
    exit()
    
for i in range(1,500):
    if A <= K * i <= B:
        print("OK")
        exit()

print("NG")

Submission status: Accepted

Solution code:
K=int(input())
# a=int(input())
A,B=map(int,input().split(" "))
#a=[int(_) for _ in input().split(" ")]

ans="NG"
a=B-A

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

#print(a,b)
print(ans)

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

Submission status: Accepted

Solution code:
K=int(input())
A,B=map(int,input().split())
b=B//K
if A<=b*K:
	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:
import sys
K=int(input())
A,B=map(int,input().split())
num=1
while K*num<=B:
  if A<=K*num and K*num<=B:
    print('OK')
    sys.exit()
  num+=1
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())
c = True
for i in range(a, b+1):
  if i%k ==0:
    print("OK")
    c = False
    break
if c:
  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:
K = int(input())
A, B = [int(s) for s in input().split()]
message = 'NG'
for i in range(1000):
    if A <= i * K and i * K <= B:
        message = 'OK'
print(message)

Submission status: Accepted

Solution code:
def I(): return int(input())
def LI(): return list(map(int,input().split()))
K = I()
A,B = LI()
Sequence = [i for i in range(A,B+1)]
for i in range(B//K+1):
    if K*i in Sequence:
        print('OK')
        break
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())

res = "NG"

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

print(res)

Submission status: Accepted

Solution code:
k=int(input())
a,b =map(int,input().split())
m=a//k
l=b//k
if a==m*k or b==l*k:
    print("OK")
elif m==l:
    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(1000):
    if a <= k * i <= b:
        ans = "OK"
        break

print(ans)

Submission status: Accepted

Solution code:

def solve():

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

    i = 0

    while True:
        if A <= i <= B:
            print("OK")
            exit()
        elif B < i:
            print("NG")
            exit()

        i += K


if __name__ == "__main__":
    solve()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
a, b = map(int, input().split())
i=a
j=0
while i<=b:
    if i%N==0:
        j=1
        break
    i+=1
if j==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")
   exit()
print("NG")

Submission status: Accepted

Solution code:
K=int(input())
N,M=map(int,input().split())
FLAG=0
for i in range(1000):
    if K*i>=N and K*i<=M:
        print("OK")
        FLAG=1
        break
if FLAG==0:
    print("NG")

Submission status: Accepted

Solution code:
def main():
    k=int(input())
    a,b=map(int,input().split())
    d=a//k
    tmp=k*d
    while tmp<=b:
        if tmp>=a and tmp<=b:
            print('OK')
            exit()
        tmp+=k
    print('NG')

if __name__=='__main__':
    main()

Submission status: Accepted

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

t = 0
flg = False
for i in range(1000):
    t += K
    if A <= t <= B:
        flg = True
        break
    if t > B:
        break

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect
import copy
import heapq
import math
import sys
from collections import *
from itertools import accumulate, combinations, permutations, product
from math import gcd
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

k=int(input())
a,b=map(int,input().split())
tmp=0
while tmp<=b:
    tmp+=k
    if a<=tmp<=b:
        print("OK")
        quit()
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:
a=int(input())
b,c=map(int, input().split())


if b//a<c//a or b%a==0 or c%a==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()
print("NG")

Submission status: Accepted

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

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

min = int(AB[0] / K)
max = int(AB[1] / K)

if (max - min < 1):
    if (AB[0] % K == 0):
        print("OK")
    else:
        print("NG")
else:
    print("OK")

Submission status: Accepted

Solution code:
def read_int():
    return int(input())

def read_int_map():
    return map(int,input().split(' '))

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

def read_s_list_loop(n):
    return [input() for _ in range(n)]


K = read_int()
A,B = read_int_map()
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 = [int(i) for i in input().split()]

num_list = [i for i in range(a, b + 1)]
ans = list(map(lambda x: x % k, num_list))

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding:utf-8

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq
import itertools



#sys.setrecursionlimit(10**7)
#N, Q = map(int, input().split())
#G = [list(input()) for i in range(H)]
#INF = V * 10001
#A = [int(i) for i in input().split()]
#AB = [list(map(int, input().split())) for _ in range(K)]

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

while True:
    if(A<=KK and KK<=B):
        print("OK")
        break
    elif(B<KK):
        print("NG")
        break
    KK+=K

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
K = int(input())
A, B = map(int, input().split())
# 文字列の入力
#s = input()
#開業されたN個要素を受け付ける
#list = [input() for i in range(N)]
i=A
while(i<=B):
    if(i%K==0):
        print("OK")
        exit()
    i=i+1

print("NG")

Submission status: Accepted

Solution code:
k,a,b = map(int,open(0).read().split())
if b//k > a//k or b%k == 0 or a%k == 0:
  print("OK")
else:
  print("NG")

Submission status: Accepted

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

print('NG')

Submission status: Accepted

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

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

if flag:
  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())
flag=False
for i in range(500):
    if (K*i) >=A and (K*i) <=B:
        flag=True

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