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())
i = 0
Flag = False
while True:
  k = K * i
  if k >= A and k <= B:
    Flag = True
    break
  if k > B:
    break
  i = i + 1
print('OK' if Flag == True else 'NG')

Submission status: Accepted

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

qA, modA = divmod(A, K)

if modA == 0:
  print("OK")
else:
  if (qA+1)*K <= B:
    print("OK")
  else:
    print("NG")

Submission status: Accepted

Solution code:
# coding: utf-8
def main():
    k = int(input())
    a, b = map(int, input().split())
    n = a//k
    num = 0
    while num <= b:
        num = k * n
        if a <= num and num <= b:
            print("OK")
            quit()
        n += 1
    print("NG")

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# vim: set fileencoding=utf-8

# pylint: disable=unused-import, invalid-name, missing-docstring, bad-continuation


"""Module docstring
"""

import functools
import heapq
import itertools
import logging
import math
import random
import string
import sys
from argparse import ArgumentParser
from collections import defaultdict, deque
from copy import deepcopy
from typing import Dict, List, Optional, Set, Tuple


def solve(multiple: int, min_value: int, max_value: int) -> bool:
    return max_value - (max_value % multiple) >= min_value


def do_job():
    "Do the work"
    LOG.debug("Start working")
    # first line is number of test cases
    K = int(input())
    A, B = map(int, input().split())
    # values = []
    # for _ in range(N):
    #     values.append(input().split())
    result = solve(K, A, B)
    print("OK" if result else "NG")


def print_output(testcase: int, result) -> None:
    "Formats and print result"
    if result is None:
        result = "IMPOSSIBLE"
    print("Case #{}: {}".format(testcase + 1, result))
    # 6 digits float precision {:.6f} (6 is the default value)
    # print("Case #{}: {:f}".format(testcase + 1, result))


def configure_log() -> None:
    "Configure the log output"
    log_formatter = logging.Formatter("%(lineno)d - " "%(message)s")
    handler = logging.StreamHandler(sys.stdout)
    handler.setFormatter(log_formatter)
    LOG.addHandler(handler)


LOG = None
# for interactive call: do not add multiple times the handler
if not LOG:
    LOG = logging.getLogger("template")
    configure_log()


def main(argv=None):
    "Program wrapper."
    if argv is None:
        argv = sys.argv[1:]
    parser = ArgumentParser()
    parser.add_argument(
        "-v",
        "--verbose",
        dest="verbose",
        action="store_true",
        default=False,
        help="run as verbose mode",
    )
    args = parser.parse_args(argv)
    if args.verbose:
        LOG.setLevel(logging.DEBUG)
    do_job()
    return 0


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    sys.exit(main())


class memoized:
    """Decorator that caches a function's return value each time it is called.
    If called later with the same arguments, the cached value is returned, and
    not re-evaluated.
    """

    def __init__(self, func):
        self.func = func
        self.cache = {}

    def __call__(self, *args):
        try:
            return self.cache[args]
        except KeyError:
            value = self.func(*args)
            self.cache[args] = value
            return value
        except TypeError:
            # uncachable -- for instance, passing a list as an argument.
            # Better to not cache than to blow up entirely.
            return self.func(*args)

    def __repr__(self):
        """Return the function's docstring."""
        return self.func.__doc__

    def __get__(self, obj, objtype):
        """Support instance methods."""
        return functools.partial(self.__call__, obj)

Submission status: Accepted

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


ma = A//K
if A%K==0:
    print('OK')
elif K*(ma+1)>=A and K*(ma+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:
        print("OK")
        c += 1
        break
    else:
        continue
if c == 0:
    print("NG")

Submission status: Accepted

Solution code:
target = int(input())
plus = target
range = input().rstrip().split(" ")
min = int(range[0])
max = int(range[1])
answer = 0
while target <= max:
    if target >= min:
        answer += 1
        break
    target += plus
if answer == 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:
n = int(input())
a ,b = list( map( int ,input().split()))
if a %n == 0 or b %n == 0:
  print('OK')
  exit(0)
if ( b//n - a //n >=1 ):
  print('OK')
else:
  print('NG')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
k = int(input())
x = input()
a = int(x.split()[0])
b = int(x.split()[1])
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())
C=A%K
D=B%K
if C==0 or D==0:
 print("OK")
elif (int(B/K)-int(A/K))>=1:
 print("OK")
else:
 print("NG")

Submission status: Accepted

Solution code:
S = int(input())
N, M = map(int, input().split())

if N%S == 0:
  print("OK")
elif N%S != 0 and M >= N + S - N%S:
  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:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys


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


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


if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

num = k
while num <= b:
    if a <= num:
        print("OK")
        exit()
    num += k

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

Submission status: Accepted

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

x = 0

while x < a:
    x += k

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

Submission status: Accepted

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

# process
result = False
if -(-A//K)*K <= B//K*K:
    result = True

# output
print("OK" if result 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")
        break
    elif i==B and i % K !=0:
        print("NG")

Submission status: Accepted

Solution code:
K = int(input())
S, W = map(int, input().split())

for i in range(S, W+1):
    if i%K==0:
        print("OK")
        exit()
else:print("NG")

Submission status: Accepted

Solution code:
# coding: utf-8
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())
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 calculate(k, a, b):
    result = False
    for i in range(a, b + 1):
        if i % k == 0:
            result = True
            break

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


calculate(K, A, B)

Submission status: Accepted

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


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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding: utf-8

import sys
import math
import collections
import itertools
from inspect import currentframe
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]

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

a = 1
while True:
    if A <= a*K <= B:
        print("OK")
        break
    else:
        a += 1
    if B < a*K:
        print("NG")
        break

Submission status: Accepted

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

for i in range(1020):
    if i>=A and i<= B:
        if i%K==0:
            print("OK")
            break
else:
    print("NG")

Submission status: Accepted

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

    bai = ((a-1) // k) + 1
    if k * bai <= b:
        print('OK')
    else:
        print('NG')


##########
if __name__ == "__main__":
    a()

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:
from math import floor
k = int(input())
a,b=map(int,input().split())
f=True
for p in range(a,b+1):
  if p%k==0:
    f=False
    break
if f:
  print("NG")
else:
  print("OK")

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

Submission status: Accepted

Solution code:
import sys

K = int(input())
A, B = map(int, input().split())
ans = 0
while True:
    ans += K
    if A <= ans <= B:
        print("OK")
        sys.exit()
    elif ans > B:
        print("NG")
        sys.exit()
    else:
        pass

Submission status: Accepted

Solution code:
import math

def Next(): return input()
def NextInt(): return int(Next())
def NextInts(): return map(int,input().split())
def Nexts(): return map(str,input().split())
def NextIntList(): return list(map(int,input().split()))
def RowInts(n): return [input() for i in range(n)]


k = int(input())
a,b = NextInts()

ju = False

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def isOK(p0, p1):
    for i in range(p0, p1 + 1):
        if i % paramK == 0:
            return True
    return False

paramK = int(input())
params1 = list(map(lambda x: int(x), input().split(' ')))

if isOK(params1[0], params1[1]):
    print('OK')
else:
    print('NG')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from sys import stdin
from operator import itemgetter
from collections import deque, Counter
import math
import pprint
from functools import reduce
# stdin = open("sample.txt")

MOD = 1000000007

def keta(kazu):
    kazu_str = str(kazu)
    kazu_list = [int(kazu_str[i]) for i in range(0, len(kazu_str))]
    return kazu_list

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def combination(m,n):
    if n > m:
        return 'すまん'
    return math.factorial(m) // (math.factorial(m-n) * math.factorial(n))

def main():
    a = int(stdin.readline().rstrip())
    b, c = [int(x) for x in stdin.readline().rstrip().split()]
    check = 0
    while b <= c:
        if b % a == 0:
            check += 1
        b += 1
    if check > 0:
        print("OK")
    else:
        print("NG")
main()

Submission status: Accepted

Solution code:
K = int(input())
A, B = map(int, input().split())
if A <= K * (A // K) + K and K * (A // K) + K <= B:
    print("OK")
else:
    if A <= K * (A // K) and K * (A // K) <= B:
        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 A//K != B//K:
    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
if count==0:
  print("NG")
else:
  print("OK")

Submission status: Accepted

Solution code:
k = int(input())
gr = list(map(int,input().split()))
tmp = k
while True:
  if gr[0] <= k and k <=gr[1]:
    print('OK')
    break
  if k > gr[1]:
    print('NG')
    break
  k = k + tmp

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k = int(input())
s = list(map(int, input().split()))
a = s[0]
b = s[1]
flg = 0
for num in range(a,b+1):
    if(num%k == 0):
        flg = 1
        break
if flg == 1:
    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):
    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 or B//K != A//K:
    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:
def validate(A, B, K):
    for n in range(A, B + 1):
        if n % K == 0:
            return True
    return False


def main():
    K = int(input())
    A, B = list(map(int, input().split(' ')))
    if validate(A, B, K):
        print('OK')
    else:
        print('NG')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

list_ab = [i for i in range(a,b+1)]
ans = 'NG'

for j in range(len(list_ab)):
  if list_ab[j] % k ==0:
    ans = 'OK'
    break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k=int(input())
a,b=map(int,input().split())
for i in range(1000):
    if k*i>=a and k*i<=b:
        print("OK")
        exit()
print("NG")

Submission status: Accepted

Solution code:
K = int(input())
A,B = map(int,input().split())
a = A//K
b = B // K
c = b-a
if A % K == 0 or B % K == 0:
  print("OK")
else:
  if c==0:
    print("NG")
  else:
    print("OK")

Submission status: Accepted

Solution code:
from sys import stdin
import math
import fractions

k = int(stdin.readline().rstrip())
a, b = [int(x) for x in stdin.readline().rstrip().split()]

result = 0
flag = False
for i in range(10000):
    result += k
    if (a <= result and b >= result):
        print('OK')
        flag = True
        break

if (flag == False):
    print('NG')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k=int(input())
a,b=map(int,input().split())
n=0
while True:
    n+=1
    if a<=n*k<=b:
        print('OK')
        break
    elif b<n*k:
        print('NG')
        break
    else:
        continue

Submission status: Accepted

Solution code:
K = int(input())
A, B = map(int, input().split())
A_shou = A // K
B_shou = B // K
if (A_shou != B_shou) or (A % K == 0):
    print('OK')
else:
    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
    if i==b:
        print("NG")

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:

MOD = 10 ** 9 + 7

def main():
    for _ in inputt(1):
        k, = inputi()
        a, b = inputi()
        if b // k - (a - 1) // k > 0:
            print("OK")
        else:
            print("NG")




# region M


# region import

from math import *
from heapq import *
from itertools import *
from functools import reduce, lru_cache, partial
from collections import Counter, defaultdict
import re, copy, operator, cmath
import sys, io, os, builtins
sys.setrecursionlimit(1000)

# endregion

# region fastio

BUFSIZE = 8192
class FastIO(io.IOBase):
    newlines = 0
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = io.BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(io.IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
def print(*args, **kwargs):
    if args:
        sys.stdout.write(str(args[0]))
        split = kwargs.pop("split", " ")
        for arg in args[1:]:
            sys.stdout.write(split)
            sys.stdout.write(str(arg))
    sys.stdout.write(kwargs.pop("end", "\n"))
def debug(*args, **kwargs):
    print("debug", *args, **kwargs)
    sys.stdout.flush()
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip()
inputt = lambda t = 0: range(t) if t else range(int(input()))
inputs = lambda: input().split()
inputi = lambda k = int: map(k, inputs())
inputl = lambda t = 0, k = lambda: list(inputi()): [k() for _ in range(t)] if t else list(k())

# endregion

# region bisect

def len(a):
    if isinstance(a, range):
        return -((a.start - a.stop) // a.step)
    return builtins.len(a)
def bisect_left(a, x, key = None, lo = 0, hi = None):
    if lo < 0: lo = 0
    if hi == None: hi = len(a)
    if key == None: key = do_nothing
    while lo < hi:
        mid = (lo + hi) // 2
        if key(a[mid]) < x: lo = mid + 1
        else: hi = mid
    return lo
def bisect_right(a, x, key = None, lo = 0, hi = None):
    if lo < 0: lo = 0
    if hi == None: hi = len(a)
    if key == None: key = do_nothing
    while lo < hi:
        mid = (lo + hi) // 2
        if x < key(a[mid]): hi = mid
        else: lo = mid + 1
    return lo
def insort_left(a, x, key = None, lo = 0, hi = None):
    lo = bisect_left(a, x, key, lo, hi)
    a.insert(lo, x)
def insort_right(a, x, key = None, lo = 0, hi = None):
    lo = bisect_right(a, x, key, lo, hi)
    a.insert(lo, x)
do_nothing = lambda x: x
bisect = bisect_right
insort = insort_right
def index(a, x, default = None, key = None, lo = 0, hi = None):
    if lo < 0: lo = 0
    if hi == None: hi = len(a)
    if key == None: key = do_nothing
    i = bisect_left(a, x, key, lo, hi)
    if lo <= i < hi and key(a[i]) == x: return a[i]
    if default != None: return default
    raise ValueError
def find_lt(a, x, default = None, key = None, lo = 0, hi = None):
    if lo < 0: lo = 0
    if hi == None: hi = len(a)
    i = bisect_left(a, x, key, lo, hi)
    if lo < i <= hi: return a[i - 1]
    if default != None: return default
    raise ValueError
def find_le(a, x, default = None, key = None, lo = 0, hi = None):
    if lo < 0: lo = 0
    if hi == None: hi = len(a)
    i = bisect_right(a, x, key, lo, hi)
    if lo < i <= hi: return a[i - 1]
    if default != None: return default
    raise ValueError
def find_gt(a, x, default = None, key = None, lo = 0, hi = None):
    if lo < 0: lo = 0
    if hi == None: hi = len(a)
    i = bisect_right(a, x, key, lo, hi)
    if lo <= i < hi: return a[i]
    if default != None: return default
    raise ValueError
def find_ge(a, x, default = None, key = None, lo = 0, hi = None):
    if lo < 0: lo = 0
    if hi == None: hi = len(a)
    i = bisect_left(a, x, key, lo, hi)
    if lo <= i < hi: return a[i]
    if default != None: return default
    raise ValueError

# endregion

# region csgraph
# TODO

class Tree:
    def __init__(n):
        self._n = n
        self._conn = [[] for _ in range(n)]
        self._list = [0] * n
    def connect(a, b):
        pass

# endregion

# region ntheory

class Sieve:
    def __init__(self):
        self._n = 6
        self._list = [2, 3, 5, 7, 11, 13]
    def extend(self, n):
        if n <= self._list[-1]: return
        maxbase = int(n ** 0.5) + 1
        self.extend(maxbase)
        begin = self._list[-1] + 1
        newsieve = [i for i in range(begin, n + 1)]
        for p in self.primerange(2, maxbase):
            for i in range(-begin % p, len(newsieve), p):
                newsieve[i] = 0
        self._list.extend([x for x in newsieve if x])
    def extend_to_no(self, i):
        while len(self._list) < i: 
            self.extend(int(self._list[-1] * 1.5))
    def primerange(self, a, b):
        a = max(2, a)
        if a >= b: return
        self.extend(b)
        i = self.search(a)[1]
        maxi = len(self._list) + 1
        while i < maxi:
            p = self._list[i - 1]
            if p < b:
                yield p
                i += 1
            else: return
    def search(self, n):
        if n < 2: raise ValueError
        if n > self._list[-1]: self.extend(n)
        b = bisect(self._list, n)
        if self._list[b - 1] == n: return b, b
        else: return b, b + 1
    def __contains__(self, n):
        if n < 2: raise ValueError
        if not n % 2: return n == 2
        a, b = self.search(n)
        return a == b
    def __getitem__(self, n):
        if isinstance(n, slice):
            self.extend_to_no(n.stop + 1)
            return self._list[n.start: n.stop: n.step]
        else:
            self.extend_to_no(n + 1)
            return self._list[n]

sieve = Sieve()
def isprime(n):
    if n <= sieve._list[-1]:
        return n in sieve
    for i in sieve:
        if not n % i: return False
        if n < i * i: return True
prime = sieve.__getitem__
primerange = lambda a, b = 0: sieve.primerange(a, b) if b else sieve.primerange(2, a)
def factorint(n):
    factors = []
    for i in sieve:
        if n < i * i: break
        while not n % i:
            factors.append(i)
            n //= i
    if n != 1: factors.append(n)
    return factors
factordict = lambda n: Counter(factorint(n))

# endregion

# region main

if __name__ == "__main__":
    main()

# endregion


# endregion

Submission status: Accepted

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

a_r = a % k
a_m = a // k
b_r = b % k
b_m = b // k

if (a_m != b_m) or (a_r == 0) or (b_r == 0):
    print('OK')
else:
    print('NG')

Submission status: Accepted

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

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

Submission status: Accepted

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

KA = A / K
KB = B / K
if KB >= ceil(KA):
    print("OK")
else:
    print("NG")

Submission status: Accepted

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

Submission status: Accepted

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

ap = a//k
aq = a%k
bp = b//k

if ap == bp and aq>0:
    print("NG")
else:
    print("OK")

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:
# -*- coding: utf-8 -*-

###
# main
if(__name__ == '__main__'):
    # input
    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")

# else:
    # do nothing

Submission status: Accepted

Solution code:
#A
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())
il2 = [int(k) for k in input().split()]
A = il2[0]
B = il2[1]

result = False

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

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

Submission status: Accepted

Solution code:
k = int(input())
a,b = map(int,input().split())
if a<=(a//k)*k<=b or a<=(b//k)*k<=b:
  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:
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:
def solve(k, a, b):
    for i in range(a, b+1):
        if i % k == 0:
            return 'OK'
    return 'NG'

if __name__ == "__main__":
    k = int(input())
    a, b = map(int, input().split(' '))
    print(solve(k, a, b))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

c=b//N
if N*c>=a :
    print('OK')
else:
    print("NG")

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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