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:
def main():
    base_distance = int(input().rstrip())
    min_distance, max_distance = (int(i) for i in input().rstrip().split(' '))
    if (max_distance // base_distance) * base_distance >= min_distance:
        print('OK')
    else:
        print('NG')


if __name__ == '__main__':
    main()

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")
    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:
    print('OK')
    exit()
print('NG')

Submission status: Accepted

Solution code:
k = int(input())
a,b = map(int,input().split())
count = 1
flag = 0
while k * count <= b:
    if k * count >= a and k * count <= b:
        flag = 1
        count += 1
    else:
        count += 1
if flag == 1:
    print("OK")
else:
    print("NG")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


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

    for i in range(0, 100):
        if A <= K * i <= B:
            print("OK")
            return
    print("NG")


def main():
    solve()


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
k = int(input())
a, b = map(int, input().split())
cal = 0
while cal <= b:
    if a <= cal <= b:
        print('OK')
        break
    else:
        cal += k
if cal > b:
    print('NG')

Submission status: Accepted

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


      
if __name__ == '__main__':
  main()
  print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
k = int(input())
a,b = map(int,input().split())
n = range(k,1001,k)
if any(a <= i and i <= b for i in n):
    print('OK')
else:
    print('NG')

Submission status: Accepted

Solution code:
K,T=[input() for i in range(2)]
A,B=map(int,T.split())
K=int(K)
if (A//K)*K>=A or((A//K)+1)*K<=B:
  print("OK")
else:
  print("NG")

Submission status: Accepted

Solution code:
import sys
import time
import math
def inpl():
    return list(map(int, input().split()))
st = time.perf_counter()
# ------------------------------

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

# ------------------------------
ed = time.perf_counter()
print('time:', ed-st, file=sys.stderr)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

for i in range(1, 1001):
    if A <= i * K and i * K <= B:
        print("OK")
        sys.exit()
        
print("NG")

Submission status: Accepted

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

if __name__ == "__main__":
    main()

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())
F = True

while a<=b:
  if a%n == 0:
    print('OK')
    F = False
    break 
  a += 1

if F:
  print('NG')

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
K = int(input())
A,B = map(int,input().split())
 
if (B//K *K)>=A:
  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(0)
print('NG')

Submission status: Accepted

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


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');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:
    flag = True
    break 

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def judge(a,b):
    for i in range(a,b+1):
        if i%k == 0: return 'OK'
    return 'NG'

print(judge(a,b))

Submission status: Accepted

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

for i in range(1,1000):
    x = K * i
    if A <= x <= B:
        print('OK')
        exit()
    else:
        continue

print('NG')

Submission status: Accepted

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

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

print('NG')

Submission status: Accepted

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

for i in range(1, 1000):
    num = K * i
    if B < num :
        break
    elif A <= num <= B:
        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())

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
K = input()
NUM = list(map(int,input().split()))
count = 0
for num in range(NUM[1]-NUM[0]+1):
  if ((NUM[0]+num )% int(K) == 0):
    print("OK")
    count += 1
    break

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
K = int(input())
a,b = map(int,input().split())
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())
a,b = map(int, input().split())

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
k=int(input())
a,b=map(int,input().split())
ans='NG'
while b>=a:
    if a%k==0:
        ans='OK'
        a+=1
    else:
        a+=1
        continue
print(ans)

Submission status: Accepted

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

for i in range(1, 501):
    if int(A) <= K*i <= int(B):
        x = True

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
lim_min, lim_max = map(int, input().split())

if lim_min % n == 0 :
  print('OK')
elif lim_min + n - (lim_min % n) <= lim_max:
  print('OK')
else:
  print('NG')

Submission status: Accepted

Solution code:
k = int(input())
a, b = list(map(int, input().split()))
s = [i for i in range(a, b+1) if i % k == 0]
if a == b and a % k == 0:
    print('OK')  
elif len(s)==0:
    print('NG')    
else:
    print('OK')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

    return('NG')

print(main())

Submission status: Accepted

Solution code:
import sys
def Ii():return int(sys.stdin.buffer.readline())
def Mi():return map(int,sys.stdin.buffer.readline().split())
def Li():return list(map(int,sys.stdin.buffer.readline().split()))

k = Ii()
a,b = Mi()

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

Submission status: Accepted

Solution code:
n = int(input())
a, b = input().split()
a,b = int(a) , int(b)
flag = True
for i in range(1000,1,-1):
    if i%n==0:
        if a<=i and i<=b:
            print('OK')
            flag = False
            break
if flag:
    print('NG')

Submission status: Accepted

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

a = B // K

if a*K >= A:
    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())
count = 0

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

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

Submission status: Accepted

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

k, (a, b) = int(input()), tuple(map(int, input().split()))
print('OK' if a <= (b // k) * k else 'NG')

Submission status: Accepted

Solution code:
K = int(input())
A, B = map(int, input().split())
for x in range(A, B + 1):
    if x % 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())
XK = list(x * K for x in range(1, 1000//K + 1))
for i in XK:
    if (A <= i) & (i <= B):
        print('OK')
        break
else:
    print('NG')

Submission status: Accepted

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

lst = list(range(A, B + 1))

for i in lst:
  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())
if B-A >= K-1:
  print('OK')
elif (B//K)*K >= A:
  print('OK')
else:
  print('NG')

Submission status: Accepted

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

for k in range(A, B+1):
    if k % K == 0:
        check = True
    else:
        continue
if check:
    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 = 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:
import math

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

if k == 1:
    print("OK")
    exit()
elif a <= k <= b :
    print("OK")
    exit()

cnt = 1
while True:
    tmp = cnt * k
    if a <=  tmp <= b:
        print("OK")
        exit()
    elif b <= tmp:
        print("NG")
        exit()
    cnt += 1

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
from math import sqrt, gcd, ceil, log
from bisect import bisect
from collections import defaultdict, Counter
inp = sys.stdin.readline
read = lambda: list(map(int, inp().strip().split()))

# sys.setrecursionlimit(10**6)

def fix(arr, d = 0):
	lis = [0]*len(arr)
	if d:
		gcd_ = arr[-1]
		for i in range(len(arr)-1, -1, -1):
			gcd_ = gcd(gcd_, arr[i])
			lis[i] = gcd_
	else:
		gcd_ = arr[0]
		for i in range(len(arr)):
			gcd_ = gcd(gcd_, arr[i])
			lis[i] = (gcd_)
	return(lis)

def solve():
	k = int(input())
	a, b = read()
	if a%k == 0 or b%k == 0 or a <= (b//k)*k <= b:
		print("OK")
	else:
		print("NG")

	





		

if __name__ == "__main__":
	solve()

Submission status: Accepted

Solution code:
from sys import exit

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:
k = int(input())
a,b = map(int, input().split())
largest = (b//k)*k
print("OK" if largest >= a else "NG")

Submission status: Accepted

Solution code:
import numpy as np
import sys

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

array = np.arange(A, B+1)

for _ in array:
    if(_%K == 0):
        print("OK")
        sys.exit(0)

print("NG")

Submission status: Accepted

Solution code:
import sys

K = int(input())
A,B = (int(a) for a in 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")
    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())

ans = int(c/a) * a

if b<=ans<=c:
    print('OK')
else:
    print('NG')

Submission status: Accepted

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

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

ans="NG"
for i in range(1,b+1):
    z=i*k
    if a<=z<=b:
        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')
    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"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

while b>=a:

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

    b-=1

if b<a:
    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:
from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
    return int(input())

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


def solve():
    k = ri()
    a, b = rl()
    for i in range(k, 1001, k):
        if a <= i <= b:
            print ("OK")
            return
    print ("NG")







mode = 's'

if mode == 'T':
    t = ri()
    for i in range(t):
        solve()
else:
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k = int(input())
a,b = [int(a) for a in input().split()]
c=0
for i in range (a,b+1):
  if i%k!=0:
     continue
  else:
    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())
ok_flag = False
for i in range(A, B + 1):
    if i % K == 0:
        ok_flag = True
        break
if ok_flag:
    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())
ok=False
for i in range(a, b+1):
  ok = ok or (i % k == 0)
print(['NG','OK'][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:
import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')
# from math import ceil, floor, log2
# from collections import deque
# from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np    # cumsum
# from bisect import bisect_left, bisect_right

def solve():
    K = II()
    A, B = MI()

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


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
k = int(input())
a, b = map(int, input().split())
z = 0
for i in range(a, b+1):
    if i%k == 0:
        z = 1
        break
if z == 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:
#165A
#We Love Golf

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

i = 1
while 1:
    if A <= i * K <= B:
        print("OK")
        break
    elif i * K > B:
        print("NG")
        break
    i += 1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
k, a, b = map(int, open(0).read().split())
print("NOGK"[b // k > (a - 1) // k::2])

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

# b以下の最大のKの倍数を求める
largest = (b // k) * k # 切り捨ての商をk倍することで、最大のkの倍数が求められる
if largest >= a:
    print('OK')
else:
    print('NG')

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

if f is False:
  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())

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())
chk = False

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

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

Submission status: Accepted

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

Submission status: Accepted

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

import numpy as np

c=np.arange(int(b[0]),int(b[1])+1)
z=0
for x in c:
  if x%a==0:
    z=z+1

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

Submission status: Accepted

Solution code:
k = int(input())
a, b = map(int, input().split())
x = 0
  
while True:
  x += k
  
  if a <= x <= b:
    print('OK')
    break
  
  if x > b:
    print('NG')
    break

Submission status: Accepted

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

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

Submission status: Accepted

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

n = a // k

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

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

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(1,1000):
    if K * i > 1000:
        break
    if K * i >= A and K * i <=B:
        print('OK')
        exit()

print('NG')

Submission status: Accepted

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

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

Submission status: Accepted

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

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

if ct != 0:
  print('OK')
else:
  print('NG')

Submission status: Accepted

Solution code:
k = int(input())
a,b = map(int,input().split())
m = k
while True:
  if a <= m <= b:
    print("OK")
    break
  m += k
  if m >= 1000:
    print("NG")
    break

Submission status: Accepted

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

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