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

Submission status: Accepted

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

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

    largest = (b // k) * k

    if a <= largest:
        print('OK')
    else:
        print('NG')

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
K = int(input())
i = list(map(int, input().split()))
A = i[0]
B = i[1]
C = A // K
D = B // K
E = A % K
F = B % K
if D - C > 0 or E == 0 or F == 0:
  print("OK")
else:
  print("NG")

Submission status: Accepted

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

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

Submission status: Accepted

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


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

Submission status: Accepted

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

i = B - A
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().split())
print("OK" if len([i for i in range(a, b + 1) if i % k == 0]) > 0 else "NG")

Submission status: Accepted

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

a = (B//K)*K - A

if a < 0:
    print("NG")

else:
    print("OK")

Submission status: Accepted

Solution code:
#!/usr/bin python3
# -*- coding: utf-8 -*-

import sys
input = sys.stdin.readline

def main():
    K = int(input())
    A, B = map(int, input().split())
    mx = (B//K)*K

    print('NOGK'[mx>=A::2])

if __name__ == '__main__':
    main()

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

Submission status: Accepted

Solution code:
K = int(input())
A, B = map(int, input().split())
M = ((A-1)//K + 1) * K
if M > B:
  print('NG')
else:
  print('OK')

Submission status: Accepted

Solution code:
import sys

K,A,B = map(int,open(0).read().split())
for i in range(A,B+1):
    if i % K == 0:
        print("OK")
        sys.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=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:
k=int(input())
a,b=map(int,input().split())
flag=1
for x in range(a,b+1):
  if x%k==0:
    flag=0
    print('OK')
    break
if flag:
  print('NG')

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
from itertools import permutations,  combinations, accumulate
from functools import *
from collections import deque, defaultdict, Counter
from heapq import heapify, heappop, heappush, heappushpop

INF = float('inf')
NIL = - 1

""" Input
S = input().rstrip()
A = list(map(int, input().split()))
A = np.array(input().split(), dtype=np.float64)
D = [int(input()) for _ in range(N)]
AB = [[int(x) for x in input().split()] for _ in range(N)]
PX = [[int(x) for x in input().split()] for _ in range(Q)]
"""

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



# def main():

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

Submission status: Accepted

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

Submission status: Accepted

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

m = (b // k) * k

if (m >= a):
    print("OK")
else:
    print("NG")

Submission status: Accepted

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

i = 0

while (i <= 1000):
    i += n
    if i >= a:
        break

print("OK") if i<=b else print("NG")

Submission status: Accepted

Solution code:
K = int(input())
A, B = list(map(int, input().split()))
 
N = (B // K)  * K
if (A <= N):
  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(1001):
  if A<=i*K and i*K<=B:
    ans="OK"
    break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K = int(input())

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

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


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

Submission status: Accepted

Solution code:
from collections import Counter, defaultdict
import sys

sys.setrecursionlimit(10 ** 5 + 10)
# input = sys.stdin.readline
from math import factorial
import heapq, bisect
import math
import itertools

import queue
from collections import deque



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

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





if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
inp=input
li=list
iinp=lambda : int(inp())
ent=lambda : map(int,inp().split())
lient=lambda : [int(i) for i in inp().split()]
li0= lambda x: [0 for i in range(x)]
livalor=lambda valor,x: [valor for i in range(x)]
stent=lambda : [i for i in inp()]
filldp=lambda valor,x,y: [[valor for i in range(y)] for i in range(x)]

numero=iinp()
linferior,lsuperior=ent()
multiplico=linferior//numero
while True:
    if linferior<=multiplico*numero<=lsuperior:
        print("OK")
        break
    elif lsuperior<multiplico*numero:
        print("NG")
        break
    multiplico=multiplico+1

Submission status: Accepted

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


if all(j % k != 0 for j in lis):
    print('NG')
elif any(j % k == 0 for j in lis):
    print('OK')

Submission status: Accepted

Solution code:
k=int(input())
li=list(map(int,input().split(" ")))
x=li[0]
y=li[1]
z=-1

for i in range(x,y+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 = [int(i) for i in input().split()]
print('OK' if (A + K - 1) // K <= B // K 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:
def main():
    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)

if __name__ == '__main__':
    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")
        break
else:
    print("NG")

Submission status: Accepted

Solution code:
import numpy as np
import fractions
 
K = int(input())
A,B = [int(i) for i in (input()).split(" ")]
 
if(((B//K-A//K)>0 and K<=B) or A%K==0 or B%K==0):
  print("OK")
else:
  print("NG")

Submission status: Accepted

Solution code:
K = int(input())
A,B = list(map(int,input().split()))
a = A // K
b = B // K
flag = 0
for i in range(a,b+1):
    if A <= K * i and K * i <= B:
        flag += 1
if flag != 0:
    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')
        break
else:
    print('NG')

Submission status: Accepted

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

Submission status: Accepted

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

if b - a >= k - 1:
  print("OK")
elif  k == 1:
  print("OK")
elif b == k or a == k:
  print("OK")
elif b % k == 0 or a % k == 0:
  print("OK")
elif a < k and k < b:
  print("OK")
elif a != b and k == 2:
  print("OK")
elif b < k:
  print("NG")
elif a % k > b % k:
  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 0
  print('NG')
  return 0

if __name__ == '__main__':
  main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    x, y = map(int, input().split())
    for i in range(x, y+1):
        if i%n == 0:
            print("OK")
            return
    print("NG")
    
if __name__ == "__main__":
    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')
    break
else:
  print('NG')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
k = int(input())
a, b = [int(x) for x in input().split()]
res = (a//k < b//k) or (not a%k) or (not b%k)
print('OK' if res else 'NG')

Submission status: Accepted

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

if K==1 or A%K==0 or B%K==0:
    print('OK')
elif (A==B) and (A%K == 0):
    print('OK')
elif (B-A) > K:
    print('OK')
elif (B-A) + (A%K) >=K:
    print('OK')
else:
    print('NG')

Submission status: Accepted

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

x=0

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

if x>0 or K==1:
    print('OK')
else:
    print('NG')

Submission status: Accepted

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

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

Submission status: Accepted

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

if flag==1:
  print('OK')
elif K==1:
  print('OK')
else:
  print('NG')

Submission status: Accepted

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

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

Submission status: Accepted

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

list=[]
up = int(A)

for i  in  range(int(B)-int(A)):
	list = list + [up]
	up += 1
list = list + [up]

count = 0

for t in list:
	if int(t) % int(K) ==0:
  		count+=1

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

Submission status: Accepted

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

a_1 = M.floor(a/k)
b_1 = M.floor(b/k)

if a%k == 0 or b%k == 0:
    print('OK')
elif b_1 - a_1 < 1:
    print('NG')

else :
    print('OK')

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()
    else:
        pass

print("NG")

Submission status: Accepted

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

for i in range(a,b+1):
    if i%k==0:
        l.append(i)
if [a]<=l<=[b]:
    print("OK")
else:
    print("NG")

Submission status: Accepted

Solution code:
K = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K = int(input())

minMax = list(map(int,input().strip().split()))

A = minMax[0]
B = minMax[1]

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

b = list(map(lambda x: x % K, a))

if 0 in b:
     print("OK")
else:
     print("NG")

Submission status: Accepted

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

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

print('NG')

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
c=0
p = list(map(int,input().split()))
for i in range(p[0],p[1]+1):
  if i%n==0:
    c+=1
if c==0:
  print("NG")
else:
  print("OK")

Submission status: Accepted

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

Submission status: Accepted

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

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

else :
	print('NG')

Submission status: Accepted

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

Submission status: Accepted

Solution code:


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

    result = isPossible(K, A, B)
    if result:
        print("OK")
    else:
        print("NG")

def isPossible(K, A, B):
    i = 1
    while True:
        current = K * i
        if A <= current <= B:
            return True
        if current > B:
            return False
        i += 1


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K = int(input())
A, B = map(int, input().split())
div_A, rem_A = divmod(A, K)
div_B, rem_B = divmod(B, K)
print("OK" if not all([rem_A, rem_B]) or div_B - div_A 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')
        quit()
else:
    print('NG')

Submission status: Accepted

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

while any(i % k == 0 for i in range(a,b+1)):
    print('OK')
    break
while all(i % k != 0 for i in range(a,b+1)):
    print('NG')
    break

Submission status: Accepted

Solution code:
K = int(input())
tmp = input()
tmp = str.split(tmp,' ')
A = int(tmp[0])
B = int(tmp[1])
flag = 0
for i in list(range(A,B+1)):
    if(i%K == 0):
        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())
count = ''
for c in range(a,b+1) :
    if c % k == 0 :
        count = 'OK'
        break
    else :
        count = 'NG'
print(count)

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 = tuple(map(int, input().split()))
f=False
for i in range(1,1001):
    if a<=i*k<=b:
       f=True
       break

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

Submission status: Accepted

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

Submission status: Accepted

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

a_div_k = a // k
b_div_k = b // k

a_mod_k = a % k
b_mod_k = b % k

if b < k:
    print("NG")
elif k == 1:
    print("OK")
elif k == b:
    print("OK")
elif (a_mod_k == 0) or (b_mod_k == 0) and (a_div_k == b_div_k):
    print("OK")
elif (k < a) and (a_div_k == b_div_k):
    print("NG")
else:
    print("OK")

Submission status: Accepted

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

if (B//K - A//K) >= 1 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())
i = 1
ok = False
while k*i <= b:
	if k*i >= a:
		ok = True
		break
	i += 1
if ok:
	print("OK")
else:
	print("NG")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
k = int(input())
left, right = map(int, input().split())

a = (left // k)*k

print("OK") if a == left or (a+k > left and a+k <= right) else print("NG")

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 6)
# input = sys.stdin.readline    ####
int1 = lambda x: 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)]

INF = float('inf')

def solve():
    k = II()
    a, b = MI()

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



if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
N = int(input())
A=list(map(int, input().split()))
z= 0
for i in range(A[0],A[1]+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())
 
print('OK' if (B-A >= (K-A%K)%K) else 'NG')

Submission status: Accepted

Solution code:

k = int(input())
a,b = (map(int,input().split()))
new_list = []
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())
s = 'NG'
for i in range(a, b+1):
  if i % k == 0:
    s = 'OK'
    break
print(s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
check=0
K=int(input())
A,B = (int(x) for x in input().split())
if (A>=K and A%K == 0) or (B>=K and B%K==0):
    print('OK')
elif B-A>=K:
    print('OK')
else:
    for i in range(A,B+1,1):
        if i%K == 0:
            check=1
            break
    if check == 1:
        print('OK')
    else:
        print('NG')

Submission status: Accepted

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

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

print('NG')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if a <= (((a-1)//k)+1)*k <= 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)

x = a // k
z = b // k

# print(x,z)
for i in range(z-x + 1):
#   print("fof---", k*(x+i))
  if a <= k*(x+i) and k*(x+i) <= b:
        print("OK")
        exit()
print("NG")

Submission status: Accepted

Solution code:
K = int(input())
a,b = map(int,input().split())
 
k = 1000//K
ans = "NG"

if K == 1:
  ans = "OK"
  
for i in range(1,k+1):
  k_bai = K*i
  if a<= k_bai and k_bai<=b:
    ans = "OK"
    break


print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline
from collections import defaultdict
from heapq import heappop, heappush

from decimal import *

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

##### 累乗 #####
# pow(x, y, z) -> x**y % z

##### 割り算の切り上げ #####
# tmp = -(-4 // 3)

##### dict の for文 #####
# for k, v in d.items():
#     print(k, v)

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]

inf = float('inf')
mod = 1000000007

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

def main():
	K = inputInt()
	A,B = inputMap()

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

	print("NG")

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# nCr mod m
# rがn/2に近いと非常に重くなる
def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res

# mを法とするaの乗法的逆元
def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

def egcd(a, b):
    if a == 0:
        return b, 0, 1
    else:
        g, y, x = egcd(b % a, a)
        return g, x - (b // a) * y, y

# nHr mod m
# 問題によって、combination()を切り替えること
def H(n, r, mod=10**9+7):
	# comb = Combination(n+r-1, mod)
	# return comb(n+r-1, r)
    return combination(n+r-1, r, mod)


class Combination:
    """
    O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
    n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  # 10
    """
    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        # 階乗のリストと階乗のmod逆元のリストを返す O(n)
        # self.make_modinv_list()が先に実行されている必要がある
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        # 0からnまでのmod逆元のリストを返す O(n)
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * modinv[self.mod%i] % self.mod
        return modinv

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# dfs のサンプル
def dfs(graph,parent,counter,edge):
    stk = []
    stk.append(edge)
    while len(stk) > 0:
        p = stk.pop()
        for e in graph[p]:
            if parent[p] == e:
                continue
            else:
                parent[e] = p
                counter[e] += counter[p]
                stk.append(e)

if __name__ == "__main__":
	main()

Submission status: Accepted

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

ans = "NG"
for i in range(B+1):
    if A <= K * i and K * i <= B:
        ans = "OK"
        break

print(ans)

Submission status: Accepted

Solution code:
K=int(input())
A,B=map(int,input().split())
a=A//K
b=B//K
def f(x):
    return x//1
if f(b)-f(a)>=1:
    print("OK")
elif A%K==0:
    print("OK")
else:
    print("NG")

Submission status: Accepted

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

a = A%K

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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


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

Submission status: Accepted

Solution code:
K = int(input())

A, B = [int(x) for x in input().split()]
ans = 0

for i in range(B):
    if B % K == 0:
        ans = B
        break
    B = B - 1

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

Submission status: Accepted

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

A()

Submission status: Accepted

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

r = A // K
d = A % K

if d == 0 or K * r + K <= B or 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 or K==1):
        print("OK")
        break
    if(i==B):
        print("NG")
        break

Submission status: Accepted

Solution code:
from sys import stdin

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
i=int(input())
j,k=(int(x) for x in input().split())
l=0
while True:
    if j<=l*i<=k:
        print("OK")
        break
    elif l*i>k:
        print("NG")
        break
    l+=1