output_description: Print the minimum number of coins in a line.
input_description: n m
      d1 d2 ... dm
      
  
  Two integers n and m are given in the first line. The available denominations
  are given in the second line.
attempt: n, m = [int(w) for w in input().split()]
  cs = [int(w) for w in input().split()]
  res = 50001
  
  
  def comb(i, acc):
      global cs, m
      if i >= m:
          compute(acc)
          return
      comb(i + 1, acc)
      acc.append(cs[i])
      comb(i + 1, acc)
      acc.pop()
  
  
  def compute(lst):
      global res, n
      lst = reversed(sorted(lst))
      r = 0
      v = n
      for e in lst:
          r += v // e
          v %= e
          if v == 0:
              res = min(res, r)
              break
  
  
  comb(0, [])
  print(res)
  
problem_description: Coin Changing Problem
  
    
  
  Find the minimum number of coins to make change for n cents using coins of
  denominations d1, d2,.., dm. The coins can be used any number of times.
samples: [{"input": "55 4\n    1 5 10 50", "output": "2"}, {"input": "15 6\n    1 2 7 8 12 50", "output": "2"}, {"input": "65 6\n    1 2 7 8 12 50", "output": "3"}]