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())
k2 = []
import sys
for i in range(1, 1001):
  ans = k * i
  k2.append(ans)
  if ans >= a and ans <= b:
    print('OK')
    sys.exit()
print('NG')

Submission status: Accepted

Solution code:
k = int(input())
a, b = map(int, input().split())
ans = 'NG'
ln = int(-(-b//(k/2)))
now = 1
for i in range(ln):
    now = k*i
    if a <= now <= b:
        ans = 'OK'
print(ans)

Submission status: Accepted

Solution code:
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nlargest, nsmallest
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from fractions import Fraction
# sys.setrecursionlimit(2*pow(10, 6))
# sys.stdin = open("input.txt", "r")
# sys.stdout = open("output.txt", "w")
mod = pow(10, 9) + 7
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(" ".join(map(str, var))+end)
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]


k = int(data())
a, b = sp()
for i in range(a, b+1):
    if i % k == 0:
        out("OK")
        exit()
out("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())
r="NG"
for i in range(A,B+1):
  if i%K==0:
    r="OK"
    break
print(r)

Submission status: Accepted

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

def main():
  c=A
  while c<=B:
    if c%K==0:
      return True
    c+=1
  return False

print( 'OK' if main() else 'NG')

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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

kk = k
ok = False
while(kk <= b):
    # print(kk)
    
    if kk >= a and kk <= b:
        ok = True
        break
    
    kk += k

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

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

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

Submission status: Accepted

Solution code:
K=int(input())
A,B=map(int,input().split())
x=K
i=1
flg=False
while x<=B:
    if A<=x:flg=True;break
    i+=1
    x=K*i
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 ((A // K) + 1)* K <= B:
    print('OK')
else:
    print('NG')

Submission status: Accepted

Solution code:
def solve(a,b,k):
    for x in range(a,b+1):
        if x%k==0:
            return "OK"
    return "NG"

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

Submission status: Accepted

Solution code:
K=int(input())
A,B=input().split()
A=int(A)
B=int(B)
C=A%K
if (1<=A<=B<=1000)and(1<=K<=1000):
    if B-A>=K-1:
        print("OK")
    else:
        if C==0:
            print("OK")
        elif A+K-C<=B:
            print("OK")
        elif A+K-C>B:
            print("NG")

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1001):
    if k*i >= a and k*i<=b:
        print("OK")
        exit()
    if k*i > b:
        break

print("NG")

Submission status: Accepted

Solution code:
#A
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
    else:
        c = 0
if c> 0:
    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
    break

if count > 0:
  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:
def main():
    K = int(input())
    A,B = [int(x) for x in input().split()]
    for a in range(A,B+1):
        if a % K == 0:
            print('OK')
            return
    print('NG')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
hani = input().split(" ")
a = "NG"
for i in range(int(hani[0]), int(hani[1]) + 1):
  if i % N == 0:
    a = "OK"
    break
print(a)

Submission status: Accepted

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

ans = "NG"

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

print(ans)

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
    elif i == b:
        print('NG')

Submission status: Accepted

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

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

Submission status: Accepted

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

wari = int(a/k)
amari = a%k
if amari > 0 and b < (wari+1) * k:
  print('NG')
else:
  print('OK')

Submission status: Accepted

Solution code:
k = int(input())
a, b = map(int, input().split())
for i in range(1, 1001):
    if a <= (i * k) <= b:
        print("OK")
        break
else:
    print("NG")

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
a = int(input())
b, c = map(int, input().split())
flag = 0
for i in range(b, c + 1):
  if i % a == 0:
    flag = 1
    break

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

Submission status: Accepted

Solution code:


k, a, b = [0] * 3

def format_input(filename = None):
	global k, a, b
	if filename == None:
		k = int(input())
		a, b = list(map(int, input().split()))

	elif filename == '__random__':
		from random import randint as rng
		a = rng(1, 10**3)
		b = rng(a, 10**3)
		k = rng(1, 10**3)
		print(k)
		print(a, b)

def get_answer():
	answer = 'NG'

	target = (b // k) * k

	if target >= a:
		answer = 'OK'

	return answer

if __name__ == '__main__':
	format_input()

	ans = get_answer()
	print(ans)

Submission status: Accepted

Solution code:
def main():
  K = int(input())
  A, B = map(int, input().split())
  n_A = A // K
  n_B = B // K
  if n_B > n_A:
    print('OK')
  elif n_B == n_A and B % K ==0:
    print('OK')
  elif n_B == n_A and A % K ==0:
    print('OK')
  else:
    print('NG')

main()

Submission status: Accepted

Solution code:
import math
def I():
  return input()
def II():
  return int(input())
def MII():
  return map(int, input().split())
def LMII():
  return list(map(int, input().split()))

n = II()
a, b = MII()

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

Submission status: Accepted

Solution code:
def main():
    k = int(input())
    a, b = map(int, input().strip().split())
    s = 'NG'

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

    print(s)

main()

Submission status: Accepted

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

f = 0
for x in range(i2[0],i2[1]+1):
    if x % i == 0:
        f = 1

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

Submission status: Accepted

Solution code:
N = int(input())
A,B = map(int,input().split())
if A%N == 0 or B%N == 0:
  print('OK')
elif B//N-A//N > 0:
  print('OK')
else: print('NG')

Submission status: Accepted

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

Submission status: Accepted

Solution code:

K = input()
line = input().split(" ")
a = False
for i in range(int(line[0]), int(line[1]) + 1):
    if i%int(K)==0:
        print("OK")
        a = True
        break
if a == False:
    print("NG")

Submission status: Accepted

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

if a > k:
    temae = (a//k)*k
    if a <= temae + k <= b or a <= temae <= b:
        print('OK')
    else:
        print('NG')
else:
    if a <= k <= b:
        print('OK')
    else:
        print('NG')

Submission status: Accepted

Solution code:
K=int(input())
X=input().split(" ")
A=int(X[0])
B=int(X[1])
if B//K-A//K==0:
  if A%K==0 or B%K==0:
    print("OK")
  else:
  	print("NG")
else:
  print("OK")

Submission status: Accepted

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

Submission status: Accepted

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

if math.ceil(a/k)<=math.floor(b/k):
    print('OK')
else:
    print('NG')

Submission status: Accepted

Solution code:
k=int(input())
a,b=map(int,input().split())
val=a%k
if(val==0):
	print("OK")
else:
	if(k-val+a<=b):
		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())

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

Submission status: Accepted

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


def solve(K: int, A: int, B: int):
    a=[i for i in range(0, 1001) if i % K == 0]
    b=list(range(A,B+1))
    for i in range(len(b)):
        if b[i] in a:
            print("OK")
            exit()
    print("NG")
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    K = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(K, A, B)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

list = [i for i in range(A,B+1)]
for j in list:
    if j % N == 0:
        print("OK")
        exit()
print("NG")

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K = int(input())
com = list(map(int,input().split()))
A= com[0]
B = com[1]

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

Submission status: Accepted

Solution code:
K = int(input())
A, B = map(int, input().split())
if B//K - (A-1)//K > 0:
    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(b-a+1):
    if (a+i)%k==0:
        count+=1
if count==0:
    print("NG")
else:
    print("OK")

Submission status: Accepted

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

while(K <= B):
  if(K >= A):
    print("OK")
    flag = 1
    break
  else:
    K += num
if(flag == 0):
  print("NG")

Submission status: Accepted

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

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

Submission status: Accepted

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

num_list = range(A,B+1)

ans = [x for x in num_list if x%K==0]

if len(ans)>0:
    print('OK')
else:
    print('NG')

Submission status: Accepted

Solution code:
K = int(input())
A, B = map(int, input().split())
flag = False
i = 1
while(i * K <= 1000):
  if A <= i * K <= B:
    flag = True
  i += 1
    
if flag == True:
  print("OK")
else:
  print("NG")

Submission status: Accepted

Solution code:
K = int(input())
A, B = map(int, input().split())
B = B+1
true_count = 0

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

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

Submission status: Accepted

Solution code:
K = int(input())
A, B = [int(s) for s in input().split()]
if K * (A // K + int(A % K > 0)) <= B:
    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(B//K+1):
    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())
ans = 'NG'
for i in range(a,b+1):
    if  i%k == 0:
        ans = 'OK'
print(ans)

Submission status: Accepted

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

i=0
while True:
    if A<=i*K:
        if B>=i*K:
            print('OK')
            break
        else:
            print('NG')
            break
    else:
        i+=1

Submission status: Accepted

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

Submission status: Accepted

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

def f(a,b,k):
	for j in range(a,b+1):
		if j % k == 0:
			return True
	return False
print 'OK' if f(a,b,k) else 'NG'

Submission status: Accepted

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

def main():
# 整数の入力
    k = int(input())
    # スペース区切りの整数の入力
    n = [int(x) for x in input().split(' ')]
    a = n[0]
    b = n[1]
    flag = False

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
goal=int(input())
list=input().split(" ")
max=int(list[1])
min=int(list[0])
flag=0
for i in range(min,max+1):
    if i%goal==0:
        flag=1;

if flag==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(1001):
    if K*i >= A and K*i <= B :
        print("OK")
        exit()
print("NG")

Submission status: Accepted

Solution code:
# ANSHUL GAUTAM
# IIIT-D

from math import *
from copy import *					# ll = deepcopy(l)
from heapq import *					# heappush(hp,x)
from string import *				# alpha = ascii_lowercase
from random import *				# l.sort(key=lambda l1:l1[0]-l1[1]) => ex: sort on the basis difference
from bisect import *				# bisect_left(arr,x,start,end)  => start and end parameters are temporary
from sys import stdin				# bisect_left return leftmost position where x should be inserted to keep sorted
from sys import maxsize				# minn = -maxsize
from operator import *				# d = sorted(d.items(), key=itemgetter(1))
from itertools import *				# pre = [0] + list(accumulate(l))
from collections import Counter		# d = dict(Counter(l))
from collections import defaultdict # d = defaultdict(list)

'''

'''

def solve(l):
	n = len(l)
	

N = int(stdin.readline())
a,b = list(map(int, stdin.readline().rstrip().split()))
f = 0
for i in range(a,b+1):
	if(i%N == 0):
		f = 1
		break
if(f):
	print('OK')
else:
	print('NG')

Submission status: Accepted

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

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

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

print('NG')

Submission status: Accepted

Solution code:
def main():
    from builtins import int, map, list, print
    import sys
    sys.setrecursionlimit(10 ** 6)

    input = sys.stdin.readline
    input_list = (lambda: input().rstrip().split())
    input_number = (lambda: int(input()))
    input_number_list = (lambda: list(map(int, input_list())))

    K = input_number()
    A, B = input_number_list()
    a = -(-A // K)
    b = B // K
    isOK = A <= a*K <= b*K <= B
    print(['NG', 'OK'][isOK])


if __name__ == '__main__':
    main()

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())
print("OK" if A % K == 0 or B % K == 0 or ((A//K)+1)*K <= B else "NG")

Submission status: Accepted

Solution code:
# Code for A - We Love Golf
# Use input() to fetch data from STDIN
import sys
n = int(input())
[a, b] = [int(x) for x in input().split()]

for x in range(1000):
    s = x * n
    if b >= s and a <= s:
        print("OK")
        sys.exit()

print("NG")

Submission status: Accepted

Solution code:
K=int(input())
a,b=map(int, input().split())
flag=False
for i in range(a,b+1):
    if i%K==0:
        print('OK')
        flag=True
        break
if not flag:
    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(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())

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

count = 1
total = 0
ans = False
while total <= 1000:
    total = K * count
    if A <= total and total <= B:
        ans = True
    count += 1
print("OK") if ans 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:
k = int(input())
a,b = map(int,input().split())
if a % k == 0 or b % k == 0:
    print('OK')
elif abs(a // k - b // k) > 0:
    print('OK')
else:
    print('NG')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ｋ=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('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())
a, b = list(map(int, input().split()))
c = 2
k2 = k

while True:
    if k2 <= b and k2 >= a:
        print("OK")
        break
    else:
        k2 = k * c
        c += 1

    if k2 > b:
        print("NG")
        break

Submission status: Accepted

Solution code:
k = int(input())
a,b = map(int, input().split())
if k > b:
    print('NG')
else:
    c = b // k * k
    if c >= a:
        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(1000):
    if A <= i*K and i*K <= B:
        flag = True

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'
if K == 1:
  ans = 'OK'
print(ans)

Submission status: Accepted

Solution code:
from math import ceil #切り上げ
import numpy as np
 
def inp(): return int(input()) #一個だけ読み取り
def inpm(): return map(int,input().split()) #mapオブジェクトで呼び出し
def inpl(): return list(map(int, input().split())) #数字リストをintで
def inpls(): return list(input().split()) #リストをstrで

K = inp()
A, B = inpl()

if K == A:
  print("OK")
else:
  S = A//K
  if S*K == A:
    print("OK")
  elif (S+1)*K <= B:
    print("OK")
  else:
    print("NG")

Submission status: Accepted

Solution code:
k = list(map(int, input().split()))[0]
a, b = list(map(int, input().split()))
for i in range(1, 10000):
    n = k * i
    #     print(n)
    if n >= a and n <= b:
        print("OK")
        break
    elif n > b:
        print("NG")
        break

Submission status: Accepted

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

k_goal = int(input())
a_current_min, b_current_max = map(int, input().split())

for i in range(a_current_min, b_current_max + 1):
    if i % k_goal == 0:
        print('OK')
        sys.exit(0)

print('NG')

Submission status: Accepted

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

frag = 'NG'
C = B - A
for i in range(C + 1):
    if (i + A) % K == 0:
        frag =  "OK"

print(frag)

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

Submission status: Accepted

Solution code:
k = int(input())
a,b = map(int,input().split())
ans = "NG"
x = k+k
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())

count = 0
for i in range(1, 1001):
    a = i * K
    if A <= a:
        if a <= B:
            count += 1
    else:
        pass
if count >= 1:
    print("OK")
else:
    print("NG")

Submission status: Accepted

Solution code:
# AtCoder Beginner Contest 165: A (2020/05/02)
K = int(input())
A, B = map(int, input().split())
X = A // K
Y = B // K
if A % K != 0:
    X = X + 1
if Y >= X :
    print("OK")
else:
    print('NG')

Submission status: Accepted

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

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

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(' '))
p=a
t=0
while p<=b:
    if p%k==0:
        t=1
        break

    p=p+1

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

Submission status: Accepted

Solution code:
import sys
import math

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

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

Submission status: Accepted

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

q_a, mod_a = divmod(a, k)
q_b, mod_b = divmod(b, k)

if mod_a == 0 or mod_b == 0 or q_a != q_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")
        quit()
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())
res=1
for i in range(1,1001):
    if i%K==0:
        if A<=i<=B:
            print('OK')
            exit()
print('NG')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#abd 165
#a
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:
num = int(input())

num_list = list(map(int, input().split()))

is_exist = False
for tmp in range(num_list[0], num_list[1]+1):
    if tmp % num == 0:
        is_exist = True
        break

if is_exist:
    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:
class abc_165:
    
    def __init__(self):
        pass
    
    def A(self):
        K=int(input())
        AB=list(map(int,input().split()))
        flag=False
        
        for i in range(AB[0],AB[1]+1):
            if i%K==0:
                flag=True
                break
            else :pass
        
        if flag==True:print("OK")
        else: print("NG")
    
    def B(self):
        pass
    
    def C(self):
        pass
        
    def D(self):
        pass
    
    def E(self):
        pass
    
    def F(self):
        pass
    
    
if __name__=='__main__':
    obj=abc_165()
    obj.A()

Submission status: Accepted

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

n = a//k

if (a == n*k) or (b >= (n+1)*k):
  print('OK')
else: 
  print('NG')

Submission status: Accepted

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

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

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

print('NG')

Submission status: Accepted

Solution code:
K = int(input()) # 1整数入力
A, B = map(int, input().split()) # 2以上の整数入力

i = 1
m = K
while m <= B :
	if A <= m <= B:
		print('OK')
		exit()
	i += 1
	m = K * i

print('NG')

Submission status: Accepted

Solution code:
i=int(input())
a = list(map(int, input().split()))
if int(a[0]/i)==int(a[1]/i) and a[0]%i!=0:
    print('NG')
else:
    print('OK')

Submission status: Accepted

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

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

Submission status: Accepted

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

hoge = int(a/k)
hoge *= k
hoge += k
if a%k == 0:
    print("OK")
elif a<=hoge and hoge<=b:
    print("OK")
else:
    print("NG")

Submission status: Accepted

Solution code:
k = int(input())
a, b = map(int, input().split())
n = b//k + 1

for i in range(n+1):
    if a <= (i*k) and (i*k) <= b:
        print('OK')
        exit()
print('NG')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
K = int(input())
A, B = map(int, input().split())
if B//K-(A-1)//K>=1:
    print('OK')
else:
    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:
        x += 1

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