output_description: Print the sum of the integers between 1 and N (inclusive), whose sum of digits
  written in base 10 is between A and B (inclusive).
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N A B
attempt: a = list(map(int, input().split()))
  N, A, B = a[0], a[1], a[2]
  k = 1
  x = True
  while x:
      if 10 ** (k - 1) <= N and N < 10**k:
          x = False
      else:
          k += 1
  u = 1
  M = 0
  while u <= k:
      if u == 1:
          v = 1
          while v <= 9:
              if v >= A and v <= B and v <= N:
                  M += v
              v += 1
      elif u == 2:
          v, w = 1, 0
          while v <= 9:
              while w <= 9:
                  if v + w <= B and v + w >= A and 10 * v + w <= N:
                      M += 10 * v + w
                  w += 1
              w = 0
              v += 1
      else:
          v, w, x = 1, 0, 0
          while v <= 9:
              while w <= 9:
                  while x <= 9:
                      if v + w + x >= A and v + w + x <= B and 100 * v + 10 * w + x <= N:
                          M += 100 * v + 10 * w + x
                      x += 1
                  x = 0
                  w += 1
              w = 0
              v += 1
      u += 1
  print(M)
  
problem_description: Statement
  
  Find the sum of the integers between 1 and N (inclusive), whose sum of digits
  written in base 10 is between A and B (inclusive).
samples: [{"input": "20 2 5", "output": "84\n    \n\nAmong the integers not greater than 20, the ones whose sums of digits are\nbetween 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. We should print the sum of\nthese, 84.\n\n* * *"}, {"input": "10 1 2", "output": "13\n    \n\n* * *"}, {"input": "100 4 16", "output": "4554"}]