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: n, m, q = map(int, input().split())
  List = [list(map(int, input().split())) for i in range(q)]
  
  p_max = 0
  point = 0
  A = [1] * n
  E = [m] * n
  
  while A != E:
  
      # 得点計算
      for j in range(q):
          if A[List[j][1] - 1] - A[List[j][0] - 1] == List[j][2]:
              point += List[j][3]
  
      # 最大値の更新
      if p_max < point:
          p_max = point
      point = 0
  
      # Aの更新
      for i in reversed(range(0, n)):
          if A[i] < m:
              A[i] = A[i] + 1
              if i != n - 1:
                  for k in range(i + 1, n):
                      A[k] = A[i]
              break
  
  print(p_max)
  
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"}]