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())
f = 0

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

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

Submission status: Accepted

Solution code:
def slove():
    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")

slove()

Submission status: Accepted

Solution code:
#!python3

iim = lambda: map(int, input().rstrip().split())

def resolve():
    K = int(input())
    A, B = iim()

    a, b = divmod(A, K)

    print("OK" if b == 0 or (a+1)*K <= B else "NG")

if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

K = int(input())
A, B = map(int, input().split())
if(int(B/K)-math.ceil(A/K)>=0):
    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(1,1000//K+1):
  if A <= K*i <= B:
    c = 1
print(["NG","OK"][c])

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
# from fractions import gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    K = INT()
    A, B = MAP()

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

    print("NG")

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:

N = int(input())
A = list(map(int, input().split())) 
sum = 0

for i in range(A[0],A[1]+1):
    if i % N ==0:
        sum =1
if A[0] == A[1]:
    if A[0] % N ==0:
        print("OK")
    else:
        print("NG")
else:
    if sum == 0:
        print("NG")
    else:
        print("OK")

Submission status: Accepted

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

if A%K == 0:
    print("OK")
else:
    a = (A + K) - (A%K)
    if B >= a:
        print("OK")
    else:
        print("NG")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

def cond(k, a, b):
    multi = 1
    total = k
    while total <= b:
        if total >= a:
            return True
        multi += 1
        total = k * multi
    return False

if cond(k, a, b):
    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(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())
bl = False
for i in range(a, b+1):
    if i % k == 0:
        bl = True
        break
if bl:
    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())
a=int(B//K)
if B%K==0:
  print("OK")
elif a*K>=A:
  print("OK")
else:
  print("NG")

Submission status: Accepted

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

Submission status: Accepted

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

c = (a-1) // k
d = (c+1) * k 

if b >= d:
    print('OK')
else:
    print('NG')

Submission status: Accepted

Solution code:
K=int(input())
a,b=map(int,input().split())
for x in range(a,b+1):
    if not x % K:
        print("OK");exit()
print("NG")

Submission status: Accepted

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

k = ii()
a,b = iim()
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())

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

Submission status: Accepted

Solution code:
flag = 0
k= int(input())
lists = list(map(int, input().split())) #１行の入力をi[0],i[1]というように空白で分けてを取得し、iに値を入れる
for i in range(lists[0],lists[1]+1):
    if i % k == 0:
        flag = 1
    else:
        pass
if flag ==1 :
    print('OK')
else:
    print('NG')

Submission status: Accepted

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

i = k
while(i < a):
    #print(i)
    i += k
#print(i)
if i <= b:
    print('OK')
else:
    print('NG')

Submission status: Accepted

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

for i in range(cnt,1000):
    ans = k*i
    if a <= ans and ans <= b:
        print("OK")
        break
    elif ans > b:
        print("NG")
        break

Submission status: Accepted

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

syou = A // K
mod = A % K

if mod == 0:
    print("OK")
    exit()
if (syou*K)+K <= B:
    print("OK")
else:
    print("NG")

Submission status: Accepted

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


P=A//K

if (K*(P+1)>B)&(K*P!=A):
    print('NG')
else:
    print('OK')

Submission status: Accepted

Solution code:
from heapq import *
import sys
from collections import *
from itertools import *
from decimal import *
import copy
from bisect import *
import math
sys.setrecursionlimit(4100000)
def gcd(a,b):
    if(a%b==0):return(b)
    return (gcd(b,a%b))
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())

l = [i for i in range(A, B+1)]

for i in l:
  if i%K == 0:
    print('OK')
    break
  if i == l[-1] and i%K != 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(0)
 
print("NG")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k = input()
k = int(k)
x = input().split()

a = int(x[0])
b = int(x[1])

if(k==1):
  print("OK")
  exit()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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


result=0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

i = 1
while True:
    if a <= k * i <= b:
        print("OK")
        break
    elif k * i > b:
        print("NG")
        break
    else:
        pass

    i += 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K = int(input())
A,B = map(int, input().split())
p = 0
for i in range(1000):
    if A <= K*i and K*i <= B:
        p = 1
        break
if p == 1:
    print("OK")
else:
    print("NG")

Submission status: Accepted

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

Submission status: Accepted

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

def solve(K: int, A: int, B: int) -> bool:
    for x in range(A, B + 1):
        if x % K == 0:
            return True
    return False

# generated by online-judge-template-generator v4.1.0 (https://github.com/kmyk/online-judge-template-generator)
def main():
    K = int(input())
    A, B = map(int, input().split())
    ans = solve(K, A, B)
    print(ans and 'OK' or 'NG')

if __name__ == '__main__':
    main()

Submission status: Accepted

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

sum = 0
while sum <= b:
    sum = sum + k
    if a <= sum and sum <= b:
        ret = "OK"
        break

print("{}".format(ret))

Submission status: Accepted

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

Submission status: Accepted

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

txt = 'NG'
tmp = (a // k) * k
if a == tmp or a <= tmp + k <= b:
    txt = 'OK'

print(txt)

Submission status: Accepted

Solution code:
from sys import stdin
import sys
import math

N = int(input())
A, B = list(map(int, stdin.readline().rstrip().split()))


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

Submission status: Accepted

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

if (A%K==0) or (B%K==0) or ((A//K) != (B//K)):
    print('OK')
else:
    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()


print('NG')

Submission status: Accepted

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

if B - A + (A % K) >= K:
    print("OK")
elif A % K == 0:
    print("OK")
elif B % 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:
        print("OK")
        break
else:
    print("NG")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(b-a+1):
  if a%k==0 :
    print("OK")
    h=1
    break
  else :
    a+=1
if h!=1 :
  print("NG")
else :
  pass

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

Submission status: Accepted

Solution code:
N = int(input())
A,B = map(int, input().split())
C = B // N
#print(A,B,C)
#print(range(C))
for i in range(C+1):
    if i * N >= A and i * N <= B:
        print("OK")
        exit( )
        break
print("NG")

Submission status: Accepted

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

Submission status: Accepted

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

a = A % K
b = B % K
c = A // K
d = B // K

if c < d or B-A >= K or a == 0 or b == 0:
  print('OK')
  
else:
  print('NG')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#import numpy as np
#import math
#from fractions import gcd

def main():

    ##get int
    first_input = list(map(lambda x:int(x), input().split(" ")))
    second_input = list(map(lambda x:int(x), input().split(" ")))

    ##get float
    #first_input = list(map(lambda x:float(x), input().split(" ")))
    #second_input = list(map(lambda x:float(x), input().split(" ")))

    ##get string
    #first_input = input().split(" ")

    K = first_input[0]
    A = second_input[0]
    B = second_input[1]

    for i in range(1,1001):
        kn = K*i
        if A<=kn and kn<=B:
            print("OK")
            return

    print("NG")
    return

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
K = int(input())
A,B = list(map(int,input().split(' ')))
flag = 'No'
for i in range(A,B+1):
    if i % K == 0:
        flag = 'Yes'
        
if flag == 'Yes':
    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()))
s=[]
for i in range(a,b+1):
  s.append(i%k)
if 0 in s:
  print("OK")
else:
  print("NG")

Submission status: Accepted

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

flg = False
for i in range(1,1000):
	if (a <= i * k)  and (i * k) <= b:
		flg = True
		break
if flg:
	print("OK")
else:
	print("NG")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K = int(input())
A, B = map(int, input().split())
l = list()
cnt = 1
while cnt * K <= 1000:
    l.append(cnt*K)
    cnt += 1

for i in l:
    if A <= i <= B:
        print('OK')
        exit()

print('NG')

Submission status: Accepted

Solution code:
K=input()
A,B=input().split()
S1=int(A)//int(K)
S2=S1+1
if S2*int(K) <= int(B) or S1*int(K)==int(A):
    print("OK")
else:
    print("NG")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
K = int(input())
S =  list(map(int,input().split()))
A = S[0]
B = S[1]
a = math.ceil(A/K)
if a*K <= B and a*K >= A:
    print('OK')
else:
    print('NG')

Submission status: Accepted

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

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

while True:
    if A % K == 0:
        break
    else:
        A += 1

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

flag = False

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

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

Submission status: Accepted

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

flag = 0

i = 1
while i * k <= b:
    if i*k >= a and i*k <=b:
        flag = 1
    
    i += 1

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

Submission status: Accepted

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

Submission status: Accepted

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

a = A // K
b = B // K
a_amari = A % K
b_amari = B % K
amari = min(a_amari, b_amari)
if (b - a) >= 1 or amari == 0:
    print('OK')
else:
    print('NG')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

a = list(map(int,input().split()))
x = list(map(int,input().split()))


K = a[0]
B = x[1]
A = x[0]

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

list=[]
for i in range(1000):
    list.append(i*K)

ans = []
for i in range(B-A+1):
    b = i+A
    ans.append(b)

    
for i in range(len(list)):
    if list[i] in ans:
        print("OK")
        exit()
    
print("NG")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

l = 0
while l <= b:
    l += k
    if a <= l and l <= b:
        print("OK")
        break
    elif l > b:
        print("NG")
        break

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
k=int(input())
a,b=map(int,input().split())
baisu=k
i=0
while k<=b:
    i+=1
    k=baisu*i

if a<=(i-1)*baisu<=b:
    print("OK")
else:
    print("NG")

Submission status: Accepted

Solution code:

N = int(input())
A, B = map(int, input().split())
K = 0
k = 0
while K <= B:
    K += N
    if (A<=K<=B):
        print("OK")
        break
if(K>B):
    print("NG")

Submission status: Accepted

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

count = A
status = False

while count <= B:
    if count % K == 0:
        status = True
    count += 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k=int(input())
a,b=map(int,input().split())
flag=0
if a==b:
    if a%k==0:
        flag=1

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

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

Submission status: Accepted

Solution code:
K=int(input())
A,B=map(int,input().split())
C=int(1000/K+1)
E=0
for x in range(C):
    D=K*x
    if D>=A and D<=B:
        E+=1
if E>=1:
    print('OK')
else:
    print('NG')

Submission status: Accepted

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

for j in range(1,1000):
    dis = k * j
    if (A <= dis and dis <= B):
        print('OK')
        exit()
print('NG')

Submission status: Accepted

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

c=N*(A//N+1)

if c>B and A%N!=0:
    print("NG")
else:
    print("OK")

Submission status: Accepted

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

ok=False

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())

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

flag = 0
total = 0
while total <= b:
    total += n
    if a <= total <= b:
        flag = 1
        break

if flag == 1:
    print("OK")
else:
    print("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] = list(map(int,input().split(" ")))
t = 0
for i in range (1,1001):
    if k*i >= a and k*i <= b:
        t = 1
    
if t == 1:
    print("OK")
else:
    print("NG")

Submission status: Accepted

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

total = k
while True:
    if a<=total<=b:
        print('OK')
        break
    elif total<a:
        total += k
    elif total>b:
        print('NG')
        break

Submission status: Accepted

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

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

Submission status: Accepted

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

if abs(a-b) > k:
    print("OK")
else:
    found = False
    for number in range(a, b+1):
        if number % k == 0:
            print("OK")
            found = True
            break
    if not found:
        print("NG")

Submission status: Accepted

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

if __name__ == "__main__":
  main()
  pass

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:
n=int(input())
a,b=map(int,input().split(" "))
sa=b-a
if sa>=n:
  print("OK")
elif a%n==0:
  print("OK")
elif a%n+sa>=n:
  print("OK")
else:
  print("NG")

Submission status: Accepted

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

amari = B%K
if((B - amari)>=A):
  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 a<=k*c:
    print('OK')
elif a<=k*(c+1)	and k*(c+1)<=b:
    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")
        exit()

print("NG")

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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


if __name__ == '__main__':
    inputs = read()
    print("{}".format(solve(*inputs)))

Submission status: Accepted

Solution code:


K = int(input())

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

check = 0
for i in range(int(1000/K) ):
    if K*(i+1)>=A and K*(i+1) <= B:
        print('OK')
        check = 1
        break
if check == 0:
    print('NG')

Submission status: Accepted

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

if ans1 == a/k:
    print("OK")
elif ans2 == b/k:
    print("OK")
elif ans1 < ans2:
    print("OK")
else:
    print("NG")

Submission status: Accepted

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

Submission status: Accepted

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

a=(a-1)//k
l=k*(a+1)

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

Submission status: Accepted

Solution code:
N=int(input())
A,B = map(int, input().split())
i=1
while 1:
    K=N*i
    if A <= K and K <= B:
        print('OK')
        break
    if K>B:
        print('NG')
        break
    i+=1