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

if (b//n)*n >= a:
    print("OK") 
else:
    print("NG")

Submission status: Accepted

Solution code:
k = int(input())
a, b = [int(i) for i in input().split()]
c = 0
for i in range(1000):
  if a<=k*i<=b:
    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())

flag = 0
for i in range(1000):
    if (a <= k * (i+1)) and (b >= k * (i+1)):
        print("OK")
        flag = 1
        break
if flag != 1:
    print("NG")

Submission status: Accepted

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

n=0
while(True):
   n=n+k
   if(n<a):
       continue
   elif(a<=n and n<=b):
       print("OK")
       exit()
   else:
       print("NG")
       exit()

Submission status: Accepted

Solution code:
K = int(input())
A, B = (int(x) for x in input().split())
length = (B-A) + 1
answer = True

for i in range(length):
    if A%K == 0:
        answer = True
        break
    else:
        answer = False
    A += 1

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

Submission status: Accepted

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

for i in range(b, c+1):
    if i%a==0:
        print("OK")
        ok=1
        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')
        break
    elif i ==b:
        print('NG')

Submission status: Accepted

Solution code:
def main():
    k = int(input())
    a = list(map(int, input().split()))
    if a[0]%k == 0:
        print("OK")
    elif int(a[0]/k) == int(a[1]/k):
        print("NG")
    else:
        print("OK")
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
K = int(input()) 
A, B = map(int, input().split())
import math
n = math.floor(B / K) 
if n >= A / K:
    print('OK')
else:
    print('NG')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
"""
ジャンボ高橋君はゴルフの練習をすることにしました。
ジャンボ高橋君の目標は飛距離をKの倍数にすることですが、ジャンボ高橋君の出せる飛距離の範囲はA以上B以下です。
目標の達成が可能であれば OK と、不可能であれば NG と出力してください。
"""
k = int(input())
a, b = map(int, input().split())
checkF = False
for i in range(a, b+1):
    if i % k == 0:
        checkF = True

print('OK' if checkF 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:
N = int(input())
lis = input().split()
a = int(lis[0])
b = int(lis[1])

#print(a, b)

li = []
zero = 0

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

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

Submission status: Accepted

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







Awari = -(-A // K)



if B >= Awari*K:
    print("OK")
else:
    print("NG")

Submission status: Accepted

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

c=b//k

if a<=c*k:
  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 a//k*k+k<=b:
        print('OK')
    else:
        print('NG')

Submission status: Accepted

Solution code:
K=int(input())
AB=input().split()
A=int(AB[0])
B=int(AB[1])
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())
n=a//k
if (k*n>=a and k*n<=b) or ((n+1)*k>=a and (n+1)*k<=b):
    print("OK")
else:
    print("NG")

Submission status: Accepted

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

main()

Submission status: Accepted

Solution code:
K=int(input())
A, B = map(int, input().split())
a=A//K
b=A%K
c=B%K

if(b==0 or c==0):
  print("OK")
else:
  if(1<a):
    if(a*K<=B):
      print("OK")
    else:
      print("NG")
  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
    elif i == b:
        print("NG")
        break
    else:
        continue

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;input=lambda:sys.stdin.readline().rstrip();aint=lambda:int(input());ints=lambda:list(map(int,input().split()))
import math;floor,ceil=lambda x:int(math.floor(x)),lambda x:int(math.ceil(x))
from functools import reduce;gcd=lambda*x:reduce(math.gcd,x);lcm=lambda*x:reduce(lambda x,y:(x*y)//gcd(x,y),x,1)
from collections import deque
Yes=lambda b:print("Yes"if b else"No");YES=lambda b:print("YES"if b else"NO")
is_even=lambda x:True if x%2==0 else False

def main():
  k=aint();a,b=ints()
  ans=0
  for i in range(a,b+1):
    if i%k==0:
      ans+=1
      break
  print("OK"if ans>0 else"NG")

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
K =int(input())
A,B = map(int,input().split())
f = 0
for i in range(A,B+1):

    if(i%K==0):
        print("OK")
        f =1
        break

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import os

def file_input():
    f = open('../Beginner_Contest_165/input.txt', 'r')
    sys.stdin = f

def main():
    #file_input()
    K=int(input())
    A,B=map(int, input().split())

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inp = [input() for i in range(2)]
k = int(inp[0])
inlist = inp[1].split()
low = int(inlist[0])
high = int(inlist[1])

mod = low % k
dist = k - mod
if (mod == 0):
  print("OK")
elif (low + dist <= high) :
  print("OK")
else:
  print("NG")

Submission status: Accepted

Solution code:
def main(K, A, B):
    a = int(A / K)
    b = int(B / K)
    if A == 0 or (a == b and A % K != 0):
        print('NG')
    else:
        print('OK')


if __name__ == '__main__':
    K = int(input())
    A, B = list(map(int, input().split()))
    main(K, A, B)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")

#solve
def solve():
    k = II()
    a, b = LI()
    for i in range(a, b + 1):
        if i % k == 0:
            print("OK")
            return
    print("NG")
    return


#main
if __name__ == '__main__':
    solve()

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K = int(input())
N = list(map(int, input().split())) 
flag = False

for i in range(N[0],N[1]+1):
  if i % K == 0:
    print('OK')
    flag = True
    break
   
if flag == False:
  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
  else:
    count += 0
    
if(count == 0):
  print("NG")
else:
  print("OK")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
K = int(input())
A, B = map(int, input().split())

print("OK" if A % K == 0 or B % K == 0 or A // K != B // K or K == 1 else "NG")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if A // K != B // K or (A // K == B // K and A % K == 0):
  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:
s = [input() for i in range(2)]

K = int(s[0])
A = int(s[1].split()[0])
B = int(s[1].split()[1])

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

Submission status: Accepted

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

n = sum(i%K == 0 for i in L)

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

Submission status: Accepted

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

check =0
c=a
for i in range(1001):
    if a>=b[0] and a<=b[1]:
        check = 1
        print('OK')
        break
    a=a+c
if check==0:
    print('NG')

Submission status: Accepted

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

def check(K,A,B):
    if B//K-(A-1)//K>0:
        return 'OK'
    return 'NG'
print(check(K,A,B))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
k = input()
a, b = input().split()
k = int(k)
a = int(a)
b = int(b)
a_k = math.ceil(a / k)
b_k = int(b / k)
if (b_k - a_k) >= 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:
K = int(input())
A, B = map(int, input().split())

if ((A//K)*K == A) or ((A//K + 1)*K <= B):
    print('OK') 
else:
    print('NG')

Submission status: Accepted

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

#print(K)
#print(A)
#print(B)

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


print("NG")

Submission status: Accepted

Solution code:
k = int(input())
l = input().split()
A, B = int(l[0]), int(l[1])

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

Submission status: Accepted

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

f = False
for i in range(1, 1001):
  t = i * k
  if a <= t and t <= b:
    f = True
    break
  if t > b:
    break

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

Submission status: Accepted

Solution code:
target_multi = int(input())
(min, max) = tuple(map(int, input().split(' ')))

# kで割って整数になればいい
is_ok = False
for i in range(min, max + 1):
  if(i % target_multi == 0):
    print("OK")
    is_ok = True
    break

if not(is_ok):
  print("NG")

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

iA=A//K
iB=B//K

Ks = [i*K for i in range(iA,iB+1)]

if iB == 0:
    print('NG')
else:
    for k in Ks:
        if A <= k <= B:
            print('OK')
            exit()
    print('NG')

Submission status: Accepted

Solution code:
K = int(input())
A,B = map(int,input().split())
C = A//K
if C*K == A:
    print("OK")
elif (C + 1)*K > A and (C + 1)* K <=B:
    print("OK")
else:
    print("NG")

Submission status: Accepted

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

if B-A == 0:
    if A%K==0:
        print("OK")
        exit()
    else:
        print("NG")
        exit()
else:
    pass

for i in range(A,B+1):
    if i % K == 0:
        print("OK")
        exit()
    else:
        pass
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:
#[str(i) for i in input().split(" ")]
K = int(input())
A,B=[int(i) for i in input().split(" ")]
if A%K == 0:
    print("OK")
elif (A//K+1)*K <= B:
    print("OK")
else:
    print("NG")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

c=a//K*K
d=c+K

if a<=c<=b:
    print('OK')
elif a<=d<=b:
    print('OK')
else:
    print('NG')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(sample(a,b,k))

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 findNum(a, b, k):
    for i in range(a, b+1):
        if i % k == 0:
            return True
    return False
K = int(input())
A, B = list(map(int, input().split()))
# m = (K - (A % B)) % K
print('OK' if findNum(A, B, K) else 'NG')

Submission status: Accepted

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

def is_ok(k, a, b):
  for i in range(a, b+1):
    if i % k == 0:
      return True
  return False

print('OK' if is_ok(K, A, B) else 'NG')

Submission status: Accepted

Solution code:
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")
		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')
    break
  if i == b:
    print('NG')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 2020/05/02
# AtCoder Beginner Contest 165 - A

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

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

# Output
print(ans)

Submission status: Accepted

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

ok_flg = False
for i in range(A, B+1):
    if i % K == 0:
        print('OK')
        ok_flg = True
        break
if not ok_flg:
    print('NG')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import sys
#k
k=int(input())
#a,b
a,b = (int(x) for x in input().split())

ans = math.floor(a/k)*k
if ans == a:
    print("OK")
    sys.exit()

ans += k

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

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:
k=int(input())
a,b=map(int,input().split())
num=0
flg=False
while k*num <= b:
    num+=1
    if a <= k*num <= b:
        print('OK')
        exit()
print('NG')

Submission status: Accepted

Solution code:
X = int(input())
Y, Z = map(int, input().split())
a = Y%X
if a != 0 and Z >= Y-a+X:
    print('OK')
elif a == 0:
    print('OK')
else:
    print('NG')

Submission status: Accepted

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

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

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

Submission status: Accepted

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

ans = k
flag = True
while True:
    if (ans < a):
        ans += k
        continue
    if (ans <= b):
        break
    else:
        flag = False
        break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
c = int(input())
k=0
a,b=map(int,input().split())
for ac in range(1,1000):
  if a <= (c*ac) <= b:
    k+=1
if k>=1:
  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)]
cnt = 0
for j in range(0,len(s)):
    if s[j]%k == 0:
        cnt +=1
    else:
        cnt+=0
if cnt==0:
    print('NG')
else:
    print('OK')

Submission status: Accepted

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

Submission status: Accepted

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

s="NG"
for i in range(10000):
    if k*i>=a and k*i<=b:
        s="OK"
        break

print(s)

Submission status: Accepted

Solution code:
K=int(input())

A,B=(int(x) for x in input().split())

a=A%K

b=K-a

c=A+b

if a!=0:
    if c > B:
        print('NG')
    else:
        print('OK')
else:
    print('OK')

Submission status: Accepted

Solution code:
k = int(input())
ab = input().split(" ")
a = int(ab[0])
b = int(ab[1])
n = a
m = 0
while n <= b:
  if n % k == 0:
    print("OK")
    m = 1
    break
  n += 1
if m == 0:
  print("NG")

Submission status: Accepted

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

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

if a == b:
  if (A % K) * (B % K) == 0:
    print('OK')
  else:
    print('NG')
else:
  print('OK')

Submission status: Accepted

Solution code:
# coding: utf-8

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

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

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

    if ans==0:
        print("OK")
        exit()

print("NG")

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
n=0
while n * N < A[0]:
    n = n + 1
if n * N <= A[1]:
    print("OK")
else:
    print("NG")

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        # for line in sys.stdin:
        #     lines.append(line)
        lines.append(input())
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    (k, ) = [int(e) for e in lines[0].split(' ')]
    (a, b) = [int(e) for e in lines[1].split(' ')]

    return (k, a, b)


def solve(k, a, b):

    result = 'NG'
    for i in range (1, 1001):
        if a <= k * i and k * i <= b:
            result = 'OK'
            break
    
    return  result
    


def main():
    # 出力
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
 
K = INT()
A, B = MAP()
 
for i in range(A, B+1):
	if i % K == 0:
		print("OK")
		exit()
 
print("NG")

Submission status: Accepted

Solution code:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    if len(x) == 0:
        return []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

k = onem()

a,b = m()

aa = -(-a//k)

bb = b//k
if aa <= bb:
    print("OK")
else:
    print("NG")

Submission status: Accepted

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

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

print(flag)

Submission status: Accepted

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

Submission status: Accepted

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

aa = a // N
bb = b // N

if bb - aa> 0 or a%N == 0 or b%N == 0:
  print("OK")
else:
  print("NG")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Kの入力
K = int(input())

# A,Bの入力
A,B = map(int,input().split())

if ( A <= (B//K)*K ):
    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 d-c==0 and c*k!=a and d*k!=b:
    print("NG")
else:
    print("OK")

Submission status: Accepted

Solution code:
def main():
    K = int(input())
    A, B = (int(x) for x in input().split())
    k = False
    for i in range(A, B + 1):
        if i % K == 0:
            k = True

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

if __name__ == "__main__":
    main()

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

Submission status: Accepted

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

result = []
for i in range(A,B+1):
#    print(i)
    if i % K == 0:
        result.append(1)
    else:
        result.append(0)
if sum(result) >0:
    print('OK')
else:
    print('NG')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
target = int(input())
potential = input().split(" ")
min = int(potential[0])
max = int(potential[1])
 
can = []
for i in range(min,max+1):
  result = str(i/target)
  result = result.split(".")
  if result[1] == "0":
    can.append(i)
if len(can) != 0:
  print("OK")
else:
  print("NG")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K = int(input())
[A, B] = list(map(int, input().split()))
if (B-A-1)>=K:
    print('OK')
else:
    x=A//K
    if A<=(x+1)*K<=B or A%K==0 or B%K==0:
        print('OK')
    else:
        print('NG')