output_description: Print the smallest possible sum of the digits in the decimal notation of a
  positive multiple of K.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      K
attempt: import heapq
  
  
  def small_multiple(k):
      # kの倍数で各桁の総数が最も小さくなるような、各桁の総数
      dist = [float("inf")] * k
      q = []
      # kで割った余りが1になるような最小の数は1
      heapq.heappush(q, (1, 1))
   
      while q:
          n, c = heapq.heappop(q)
          if dist[n] <= c:
              continue
          print(n, c)
          dist[n] = c
   
          if dist[(n+1) % k] > c + 1:
              heapq.heappush(q, ((n + 1) % k, c + 1))
          if dist[(n*10) % k] > c:
              heapq.heappush(q, ((n * 10) % k, c))
   
      print(dist[0])
   
   
  def main():
  	k = int(input())
      small_multiple(k)
   
   
  if __name__ == "__main__":
      main()
problem_description: Statement
  
  Find the smallest possible sum of the digits in the decimal notation of a
  positive multiple of K.
samples: [{"input": "6", "output": "3\n    \n\n12=6\u00d72 yields the smallest sum.\n\n* * *"}, {"input": "41", "output": "5\n    \n\n11111=41\u00d7271 yields the smallest sum.\n\n* * *"}, {"input": "79992", "output": "36"}]