output_description: Print the minimum possible (absolute) difference between the largest number of
  crackers received by a user and the smallest number received by a user.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N K
attempt: N = int(input())
  p = []
  if N > 0:
      for i in range(500):
          if (2 ** (2 * i) - 1) / 3 < N <= (2 ** (2 * (i + 1)) - 1) / 3:
              q = 2 * i + 1
  if N < 0:
      for i in range(1, 500):
          if -(2 ** (2 * i + 1) - 2) / 3 <= N < -(2 ** (2 * i - 1) - 2) / 3:
              q = 2 * i
  if N == 0:
      q = 1
  
  
  def cal(n, i):
      if i % 2 != 0:
          if (2 ** (i - 1) - 1) / 3 < n <= (2 ** (i + 1) - 1) / 3:
              p.append(1)
              n = n - (-2) ** (i - 1)
              i = i - 1
              if i > 0:
                  cal(n, i)
          else:
              p.append(0)
              i = i - 1
              if i > 0:
                  cal(n, i)
      elif n == 0:
          p.append(0)
          i = i - 1
          if i > 0:
              cal(n, i)
      else:
          if -(2 ** (i + 1) - 2) / 3 <= n < -(2 ** (i - 1) - 2) / 3:
              p.append(1)
              n = n - (-2) ** (i - 1)
              i = i - 1
              if i > 0:
                  cal(n, i)
          else:
              p.append(0)
              i = i - 1
              if i > 0:
                  cal(n, i)
  
      return p
  
  
  ans = cal(N, q)
  for i in range(len(ans)):
      ans[i] = str(ans[i])
  print("".join(ans))
  
problem_description: Statement
  
  Takahashi has decided to distribute N AtCoder Crackers to K users of as evenly
  as possible. When all the crackers are distributed, find the minimum possible
  (absolute) difference between the largest number of crackers received by a
  user and the smallest number received by a user.
samples: [{"input": "7 3", "output": "1\n    \n\nWhen the users receive two, two and three crackers, respectively, the\n(absolute) difference between the largest number of crackers received by a\nuser and the smallest number received by a user, is 1.\n\n* * *"}, {"input": "100 10", "output": "0\n    \n\nThe crackers can be distributed evenly.\n\n* * *"}, {"input": "1 1", "output": "0"}]