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: import numpy as np
  
  # from numba import jit
  
  n, m, q = map(int, input().split())
  a = list(range(q))
  b = list(range(q))
  c = list(range(q))
  d = list(range(q))
  for i in range(q):
      a[i], b[i], c[i], d[i] = map(int, input().split())
  
  A = np.sort(np.random.randint(1, m + 1, n))
  
  
  # @jit
  def calc_energy(A):
      energy = 0.0
      for i in range(q):
          if (A[b[i] - 1] - A[a[i] - 1]) == c[i]:
              energy += d[i]
      return energy
  
  
  T = 20000
  temperature = 200
  for t in range(T):
      A_prev = np.copy(A)
      energy_prev = calc_energy(A_prev)
  
      idx = np.random.randint(0, n)
      A[idx] = np.random.randint(1, m + 1)
      energy = calc_energy(A)
  
      if np.random.rand() < (energy - energy_prev) / temperature:
          pass
      else:
          A = np.copy(A_prev)
      temperature *= 0.999
  
  print(np.int(calc_energy(A)))
  
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"}]