output_description: If he can achieve the objective, print `OK`; if he cannot, print `NG`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      K
      A B
attempt: from sys import stdin
  import itertools
  import numpy as np
  from numba import njit
  
  
  def main():
      # 入力
      readline = stdin.readline
      N, M, Q = map(int, readline().split())
      a = np.zeros(Q, dtype=np.int64)
      b = np.zeros(Q, dtype=np.int64)
      c = np.zeros(Q, dtype=np.int64)
      d = np.zeros(Q, dtype=np.int64)
      for i in range(Q):
          a[i], b[i], c[i], d[i] = map(int, readline().split())
  
      arrays = np.array(
          list(itertools.combinations_with_replacement(range(1, M + 1), N)),
          dtype=np.int64,
      )
      l = len(arrays)
  
      print(f(l, Q, a, b, c, d, arrays))
  
  
  @njit("i8(i8,i8,i8[:],i8[:],i8[:],i8[:],i8[:,:])", cache=True)
  def f(l, Q, a, b, c, d, arrays):
      max_res = 0
      for i in range(l):
          res = 0
          for j in range(Q):
              if arrays[i][b[j] - 1] - arrays[i][a[j] - 1] == c[j]:
                  res += d[j]
          max_res = max(max_res, res)
      return max_res
  
  
  if __name__ == "__main__":
      main()
  
problem_description: 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`.
samples: [{"input": "7\n    500 600", "output": "OK\n    \n\nAmong the multiples of 7, for example, 567 lies between 500 and 600.\n\n* * *"}, {"input": "4\n    5 7", "output": "NG\n    \n\nNo multiple of 4 lies between 5 and 7.\n\n* * *"}, {"input": "1\n    11 11", "output": "OK"}]