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).

-----Constraints-----
 - 1 \leq N \leq 10^4
 - 1 \leq A \leq B \leq 36
 - All input values are integers.

-----Input-----
Input is given from Standard Input in the following format:
N A B

-----Output-----
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).

-----Sample Input-----
20 2 5

-----Sample Output-----
84

Among the integers not greater than 20, the ones whose sums of digits are between 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. We should print the sum of these, 84.
[{"code": "n, a, b = map(int, input().split())\n\nans = 0\nfor i in range(1, n + 1):\n    val = 0\n    for c in str(i):\n        val += int(c)\n    if a <= val <= b:\n        ans += i\nprint(ans)", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "N,A,B = list(map(int,input().split()))\nK = 0\nfor i in range(1,N+1):\n  if A <= sum(map(int,str(i))) <= B:\n    K += i\nprint(K)\n    \n\n", "passed": true, "time": 0.27, "memory": 14068.0, "status": "done"}, {"code": "n, a, b = (int(i) for i in input().split())\nans = 0\nfor i in range(1, n + 1):\n    str_i = str(i)\n    sum_i = 0\n    for j in str_i:\n        sum_i += int(j)\n    if a <= sum_i <= b:\n        ans += i\nprint(ans)", "passed": true, "time": 0.15, "memory": 14084.0, "status": "done"}, {"code": "n, a, b = list(map(int, input().split()))\n\nans = 0\nfor num in range(1, n+1):\n    p = num\n    digit_sum = 0\n    while p > 0:\n        digit_sum += p % 10\n        p //= 10\n    if a<= digit_sum <= b:\n        ans += num\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "n,a,b = list(map(int, input().split()))\ndef sum_digit(x):\n    s = 0\n    while x:\n        s += x % 10\n        x //= 10\n    return s\nprint(sum([i for i in range(1,n+1) if a <= sum_digit(i) <= b]))", "passed": true, "time": 0.42, "memory": 14084.0, "status": "done"}, {"code": "n, a, b = map(int, input().split())\nr = 0\nfor i in range(n + 1):\n    c = 0\n    j = i\n    for k in range(5):\n        c += j % 10\n        j = j//10\n    if a <= c and c <= b:\n        r += i\n\n    \nprint(r)", "passed": true, "time": 0.44, "memory": 14044.0, "status": "done"}, {"code": "N, A, B = map(int, input().split())\n\ndef caluculate(n):\n    sum = 0\n    while n > 0:\n        sum += n % 10\n        n = n // 10\n    return sum\n\nans = 0\nfor i in range(N+1):\n    if A <= caluculate(i) <= B:\n        ans += i\n\nprint(ans)", "passed": true, "time": 0.34, "memory": 14128.0, "status": "done"}, {"code": "n,a,b = map(int,input().split())\nans = 0\nfor i in range(1,n+1):\n    s = str(i)\n    sum = 0\n    for j in s:\n        t = int(j)\n        sum+=t\n    if a <= sum <= b:\n        ans +=i\nprint(ans)", "passed": true, "time": 0.15, "memory": 14080.0, "status": "done"}, {"code": "# coding: utf-8\n# Your code here!\n\nn, a, b = map(int, input().split())\nsum = 0\n\nfor i in range(1, n+1) : \n    tmp_sum = 0\n    for j in str(i) : \n        tmp_sum += int(j)\n    if a <= tmp_sum and tmp_sum <= b : \n        sum += i\n        \nprint(sum)", "passed": true, "time": 0.35, "memory": 14348.0, "status": "done"}, {"code": "def myfunc(A, B):\n    def resfunc(x):\n        if A <= sum(map(int,list(str(x)))) <=B:\n            return x\n        else:\n            return 0\n    return resfunc\n\nN, A, B = map(int, input().split())\nprint(sum(map(myfunc(A,B), range(1, N+1))))", "passed": true, "time": 0.28, "memory": 14052.0, "status": "done"}, {"code": "n, a, b = map(int, input().split())\n\nans = 0\nfor i in range(1,n+1):\n    w = sum(list(map(int, list(str(i)))))\n    if a <= w and w <= b:\n        ans += i\nprint(ans)", "passed": true, "time": 0.15, "memory": 14264.0, "status": "done"}, {"code": "s=list(map(int,input().split()))\n\noklist=[]\n\ndef keta(x):\n    ketalist=[]\n    for j in range(len(x)):\n        ketalist.append(int(x[j]))\n    return(sum(ketalist))\n        \n    \n\nfor i in range(s[0]+1):\n    check=keta(str(i))\n    if(s[1]<=check and check<=s[2]):\n        oklist.append(i)     \nsum_=sum(oklist)\nprint(sum_)", "passed": true, "time": 0.23, "memory": 14184.0, "status": "done"}, {"code": "N,A,B = list(map(int,input().split()))\n\nans=0\n\nfor i in range(1,N+1):\n    sum_all=0\n    tmp=i\n    while(tmp>9):\n        sum_all += tmp%10\n        tmp//=10\n    sum_all += tmp\n\n    if sum_all>=A and sum_all<=B:\n        ans+=i\n        # print(i)\n\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "n, a, b = map(int, input().split())\nans = 0\nfor i in range(n+1):\n    if a <= sum(list(map(int, list(str(i))))) <= b:\n        ans += i\nprint(ans)", "passed": true, "time": 0.17, "memory": 14120.0, "status": "done"}, {"code": "N,A,B=map(int,input().split())\nX=[]\nfor i in range(1,N+1):\n  if A<= sum(list(map(int,str(i)))) <=B:\n    X.append(i)\nprint(sum(X))", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "def mapt(fn, *args):\n    return tuple(map(fn, *args))\n\n\ndef Input():\n    return mapt(int, input().split(\" \"))\n\n\ndef main():\n    n, a, b = Input()\n    n += 1\n    data = (i\n            for i in range(1, n)\n            if a <= sum(map(int, list(str(i)))) <= b\n            )\n    print(sum(data))\n\n\nmain()", "passed": true, "time": 0.36, "memory": 14232.0, "status": "done"}, {"code": "N, A, B = map(int, input().split())\n\nL = []\nfor i in range(1, N+1):\n    j = map(int, list(str(i)))\n    if A <= sum(j) <= B:\n        L.append(i)\nprint(sum(L))", "passed": true, "time": 0.15, "memory": 14264.0, "status": "done"}, {"code": "from sys import stdin\nn, a, b = [int(x) for x in stdin.readline().rstrip().split()]\nsum = 0\n\nfor x in range(1,n+1):\n   l = x // 10000\n   m = (x % 10000) // 1000\n   n = (x % 1000) // 100\n   o = (x % 100) // 10\n   p = x % 10\n   if l+m+n+o+p >= a and l+m+n+o+p <= b:\n      sum += x\n\nprint(sum)", "passed": true, "time": 0.15, "memory": 14084.0, "status": "done"}, {"code": "N, A, B = map(int, input().split())\nsum_1 = 0\nfor i in range(1,N+1):\n    sum_order = 0\n    i_str = str(i)\n    n = len(i_str)\n    for j in range(0,n):\n        sum_order += int(i_str[j])\n    if A <= sum_order <= B:\n        sum_1 += i\nprint(sum_1)", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "N, A, B = map(int, input().split())\nlst = []\nfor i in range(N+1):\n    if i >= 1 and i < 10:\n        if i >= A and i <= B:\n            lst.append(i)\n    elif i < 100:\n        s = i // 10 + i % 10\n        if s >= A and s <= B:\n            lst.append(i)\n    elif i < 1000:\n        t = i // 100 + (i % 100) // 10 + i % 10\n        if t >= A and t <= B:\n            lst.append(i)\n    elif i < 10000:\n        u = i // 1000 + (i % 1000) // 100 + (i % 100) // 10 + i % 10\n        if u >= A and u <= B:\n            lst.append(i)\n    elif i == 10000:\n        lst.append(i)\n\nlst_sum = sum(lst)\nprint(lst_sum)", "passed": true, "time": 0.19, "memory": 14300.0, "status": "done"}, {"code": "n,a,b=map(int,input().split())\ntotal=0\nfor i in range(1,n+1):\n    x=(str(i))\n    j=0\n    total2=0\n    for j in range(len(x)):\n        total2+=int(x[j])\n    if a<=total2<=b:\n        total+=i\nprint(total)", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "n,a,b = map(int,input().split())\nans = 0\nfor i in range(1,n+1):\n    l = len(str(i))\n    total = 0\n    for j in range(1,l+1):\n        total += int(str(i)[-j])\n    if a <= total and total <= b:\n        ans += i\nprint(ans)", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "n,a,b = map(int,input().split())\nans = 0\nfor i in range(1,n+1):\n    l = list(map(int,str(i)))\n    sum_l = sum(l)\n    if sum_l >= a and sum_l <= b:\n        ans += i\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "def reverse(num):\n    sum1 = 0\n    while (num > 0):\n        remainder = num % 10\n        sum1 = remainder+sum1\n        num = num // 10\n    return sum1\n\nn,a,b = list(map(int,input().split()))\nc = 0\nfor i in range(1,n+1):\n    if reverse(i)>=a and reverse(i)<=b:\n        c+=i\nprint(c)", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "\n\n# Press the green button in the gutter to run the script.\ndef __starting_point():\n    n, a, b = list(map(int, input().split()))\n\n    ans = 0\n    for n in range(n + 1):\n        keta = len(str(n))\n        wa = 0\n        for m in range(keta):\n            tmp = str(n)\n            wa = wa + int(tmp[-m-1])\n        if a <= wa <= b:\n            ans = ans + n\n\n    print(ans)\n\n__starting_point()", "passed": true, "time": 0.32, "memory": 14212.0, "status": "done"}, {"code": "N,A,B=list(map(int, input().split()))\ns=0\nfor i in range(1,N+1):\n    k=0\n    j=i\n    while(j>0):\n        k+=j%10\n        j=j//10\n    if (A<=k and k<=B):\n        s=s+i\nprint(s)\n", "passed": true, "time": 0.3, "memory": 14072.0, "status": "done"}, {"code": "N,A,B = map(int,input().split())\n\nans = 0\n\nfor i in range(1,N+1):\n  \n  x = str(i)\n  n = len(x)\n  sum = 0\n  \n  for j in range(0,n):\n    sum = sum + int(x[j])\n  \n  if sum >= A and sum <= B:\n    ans += i\n    \nprint(ans)", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "n, a, b = map(int, input().split())\n\nres = 0\nfor i in range(1, n+1):\n  tmp = sum([int(elem) for elem in list(str(i))])\n  if a <= tmp and tmp <= b:\n    res += i\nprint(res)", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "n, a, b = map(int, input().split())\nans = 0\nfor i in range(n+1):\n    if a <= sum(list(map(int, list(str(i))))) <= b:\n        ans += i\nprint(ans)", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "n, a, b = list(map(int, input().split()))\nans = 0\n\nfor i in range(1,n+1):\n    mod = 0\n    div = i\n    while div > 0:\n        mod += (div % 10)\n        div //= 10\n    if mod >= a and mod <= b:\n        ans += i\n\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14044.0, "status": "done"}, {"code": "#!/usr/bin/env python3\nimport sys\nsys.setrecursionlimit(10**6)\n\nn, a, b = list(map(int, input().split()))\n\nans = 0\nfor i in range(1, n+1):\n    tmp = 0\n    for j in str(i):\n        tmp += int(j)\n\n    if tmp >= a and tmp <= b:\n        ans += i\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "n,a,b = map(int,input().split())\nc = 0\nfor i in range(1,n+1):\n    s = 0\n    d = i\n    while d!=0:\n        s+= d%10\n        d//=10\n    if a<=s<=b:\n        c+=i\nprint(c)", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "x = list(map(int,input().split()))\nn = int(x[0])\na = int(x[1])\nb = int(x[2])\n\nres = 0\n\nfor i in range(n+1):\n  m = sum([int(r) for r in list(str(i))])\n  if a <= m <= b:\n    res += i\n\nprint(res)", "passed": true, "time": 0.15, "memory": 14044.0, "status": "done"}, {"code": "N, A, B = list(map(int, input().split()))\n\ntotal = 0\nfor i in range(1, N+1):\n    subTotal = sum(list(map(int, str(i))))\n    if subTotal >= A and subTotal <= B:\n        total += i\n\nprint(total)\n", "passed": true, "time": 0.15, "memory": 14320.0, "status": "done"}, {"code": "N,A,B = map(int,input().split())\nans_list = []\n\nfor i in range(0,N+1):\n    if i < 10:\n        if i >= A and i <=B:\n            ans_list.append(i)\n    else:\n        temp = list(map(int,str(i)))\n        temp=sum(temp)\n        if temp >=A and temp<=B:\n            ans_list.append(i)\n            \nprint(sum(ans_list))", "passed": true, "time": 0.23, "memory": 14096.0, "status": "done"}, {"code": "N, A, B = map(int,input().split())\n\nanswer = 0\n\nfor i in range(N + 1):\n    numStrList = list(str(i))\n    numIntList = [int(s) for s in numStrList] \n\n    if A <= sum(numIntList) <= B :\n        answer += i\n\nprint(answer)", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "N,A,B=map(int,input().split())\ncount=0\nfor i in range(1,N+1):\n    acc=0\n    for j in range(len(str(i))):\n        acc+=int(str(i)[j])\n    if acc >= A and acc <= B: count+=i\nprint(count)", "passed": true, "time": 0.21, "memory": 14204.0, "status": "done"}, {"code": "N,A,B = map(int, input().split())\n \nls = []\nfor n in range(1,N+1):\n  sm = sum(int(s) for s in str(n))\n  if A <= sm <= B:\n    ls.append(int(n))\nprint(sum(ls))", "passed": true, "time": 0.15, "memory": 14188.0, "status": "done"}, {"code": "import bisect, collections, copy, heapq, itertools, math, string, sys\ninput = lambda: sys.stdin.readline().rstrip() \nsys.setrecursionlimit(10**7)\nINF = float('inf')\ndef I(): return int(input())\ndef F(): return float(input())\ndef SS(): return input()\ndef LI(): return [int(x) for x in input().split()]\ndef LI_(): return [int(x)-1 for x in input().split()]\ndef LF(): return [float(x) for x in input().split()]\ndef LSS(): return input().split()\n\ndef resolve():\n    N, A, B = LI()\n\n    ans = 0\n    for i in range(1, N + 1):\n        if A <= sum([int(i) for i in str(i)]) <= B:\n            ans += i\n\n    print(ans)\n\ndef __starting_point():\n    resolve()\n\n__starting_point()", "passed": true, "time": 0.15, "memory": 14308.0, "status": "done"}, {"code": "N, A, B = map(int, input().split())\n\nans = 0\nfor i in range(1, N+1):\n  k = list(str(i))\n  sum_i = 0\n  for j in k:\n    sum_i += int(j)\n  if A <= sum_i <= B:\n    ans += i\n    \nprint(ans)", "passed": true, "time": 0.2, "memory": 14296.0, "status": "done"}, {"code": "N, A, B = list(map(int, input().split()))\n\nres = 0\nfor i in range(1, N+1):\n    if(A <= sum(map(int, str(i))) <= B):\n        res += i\n\nprint(res)\n", "passed": true, "time": 0.15, "memory": 14264.0, "status": "done"}, {"code": "n, a, b = map(int, input().split())\n\nans = 0\nfor i in range(1, n+1):\n    t = 0\n    v = i\n    while v > 0:\n        t += v%10\n        v//=10\n    if a <= t <= b:\n        ans += i\nprint(ans)", "passed": true, "time": 0.21, "memory": 14072.0, "status": "done"}, {"code": "N, A, B = map(int, input().split())\n\n\ndef calc(N):\n    sum = 0\n    while N > 0:\n        sum += N % 10\n        N //= 10\n    return sum\n\n\nsum_num = 0\nfor i in range(1, N + 1):\n    ans = calc(i)\n    if A <= ans <= B:\n        sum_num += i\n\nprint(sum_num)", "passed": true, "time": 0.17, "memory": 14336.0, "status": "done"}, {"code": "N,A,B = map(int,input().split())\n\nans = 0\nfor i in range(N):\n    n = i + 1\n    arr = list(map(int,str(n)))\n    summ = sum(arr)\n    if summ >= A and summ <= B:\n        ans += n\nprint(ans)", "passed": true, "time": 0.23, "memory": 14112.0, "status": "done"}, {"code": "n, a, b = list(map(int, input().split()))\nans = 0\n\nfor i in range(1,n+1):\n  sum = 0\n  x = i\n  while x > 0:\n    sum += x%10\n    x //= 10 \n  if a<=sum and sum<=b:\n    ans += i\n  \nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "N, A, B = list(map(int, input().split()))\nans = []\nfor i in range(1, N + 1):\n    target = 0\n    for j in range(len(str(i))):\n        target += int(str(i)[j])\n    if A <= target <= B:\n        ans.append(i)\n\nprint((sum(ans)))\n", "passed": true, "time": 0.23, "memory": 14228.0, "status": "done"}, {"code": "N,A,B=list(map(int,input().split()))\nans=0\nfor x in range(1,N+1):\n    y=sum(int(c) for c in str(x))\n    if A<=y and y<=B:\n        ans+=x\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "N,A,B = list(map(int,input().split()))\ns = 0\nfor i in range(1,N+1):\n    tmp = sum(list(map(int,str(i))))\n    if A<=tmp and tmp <= B:\n        s += i\n\nprint(s)", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "N, A, B = list(map(int, input().split()))\nres = 0\n\nfor i in range(1, N+1):\n  num = sum(map(int, list(str(i))))\n  if A <= num <= B:\n    res += i\n    \nprint(res)\n", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "lst = input().split()\nN = int(lst[0])\nA = int(lst[1])\nB = int(lst[2])\n\ndef sum(n):\n   result = 0\n   s = str(n)\n   for i in range(len(s)):\n      result += int(s[i])\n   return result\n\ncount = 0\n\nfor i in range(1, N+1):\n   if A <= sum(i) <= B:\n      count += i\n\nprint(count)", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "n_num, a_num, b_num = map(int, input().split())\n\ndef digit_sum(num):\n    str_num = str(num)\n    digit_num = 0\n    for s in str_num:\n        digit_num += int(s)\n    return digit_num\n\ncnt = 0\nfor n in range(1, n_num+1):\n    if a_num <= digit_sum(n) <= b_num:\n\n        cnt += n\n        \nprint(cnt)", "passed": true, "time": 0.2, "memory": 14104.0, "status": "done"}, {"code": "N,A,B = map(int,input().split())\nans_list = []\n\nfor i in range(0,N+1):\n\n    temp = list(map(int,str(i)))\n    temp=sum(temp)\n    if temp >=A and temp<=B:\n        ans_list.append(i)\n            \nprint(sum(ans_list))", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "n, a, b = map(int, input().split())\nans = 0\n\nfor i in range(1, n+1):\n  if a <= sum(list(map(int, str(i)))) <= b:\n    ans += i\n    \nprint(ans)", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "n, a, b = map(int, input().split())\nsum = 0\nsum_n = 0\nfor num in range(1, n+1):\n  num2 = num\n  sum_n = 0\n  while num > 0:\n    sum_n += num % 10\n    num //= 10\n  if sum_n >= a and sum_n <= b:\n    sum += num2\nprint(sum)", "passed": true, "time": 0.15, "memory": 14020.0, "status": "done"}, {"code": "N,A,B=map(int,input().split())\nans=[]\nfor i in range(1,N+1):\n  j=i//10000+(i%10000)//1000+(i%1000)//100+(i%100)//10+(i%10)//1\n  if A<=j<=B:\n    ans.append(i)\n  \nprint(sum(ans))", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "n, a, b = list(map(int, input().split()))\n\nl = list(range(0))\n\nfor i in range(n+1):\n    res = sum(list(map(int, str(i))))\n    if res >= a and res <= b:\n        l.append(i)\n\nans = sum(list(l))\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14332.0, "status": "done"}, {"code": "def sum_of_digits(i: int) -> int:\n    result = 0\n    for _ in range(len(str(i))):\n        i, mod = divmod(i, 10)\n        result += mod\n\n    return result\n\n\ndef answer(n: int, a: int, b: int) -> int:\n    some_sums = 0\n    for i in range(1, n + 1):\n        if a <= sum_of_digits(i) <= b:\n            some_sums += i\n\n    return some_sums\n\n\ndef main():\n    n, a, b = map(int, input().split())\n    print(answer(n, a, b))\n\n\ndef __starting_point():\n    main()\n__starting_point()", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "N, A, B = map(int, input().split())\n\nSum = 0\nfor i in range(N):\n  o = (i+1)//10000\n  a = (i+1)%10000//1000\n  b = (i+1)%1000//100\n  c = (i+1)%100//10\n  d = (i+1)%10\n  e= o+a+b+c+d\n  if e >= A and e <= B:\n    Sum = Sum + (i+1)\n\nprint(Sum)", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "N, A, B = map(int, input().split())\nans = 0\nfor n in range(1, N+1):\n  if A <= sum(list(map(int,list(str(n))))) <= B:\n    ans += n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14036.0, "status": "done"}, {"code": "n, a, b = list(map(int, input().split()))\nl = []\nans = 0\nfor i in range(n):\n    l.append(str(i + 1))\nfor i in l:\n    li = list(map(int, i))\n    if a <= sum(li) <= b:\n        ans += int(i)\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14124.0, "status": "done"}, {"code": "N, A, B = map(int, input().split())\n\nsum = 0\nfor i in range(N+1):\n    x = 0\n    for j in range(len(str(i))):\n        x = x + int(str(i)[j])\n    if A <= x <= B:\n        sum = sum + i\nprint(sum)", "passed": true, "time": 0.29, "memory": 14076.0, "status": "done"}, {"code": "n,a,b=map(int,input().split())\nans=0\nfor i in range(n+1):\n    i=str(i)\n    c=0\n    for l in i:\n        c+=int(l)\n    if a<=c and c<=b:\n        ans+=int(i)\nprint(ans)", "passed": true, "time": 0.21, "memory": 14064.0, "status": "done"}, {"code": "n, a, b = list(map(int, input().split()))\n\nans = 0\nfor x in range(1, n + 1):\n    c = sum(map(int, str(x)))\n    if a <= c <= b:\n        ans += x\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "n,a,b = map(int,input().split())\n\nans= 0\n\nfor i in range(n+1):\n    if a <= sum(list(map(int, str(i)))) <= b:\n        ans = ans + i\n\nprint(ans)", "passed": true, "time": 0.15, "memory": 14096.0, "status": "done"}, {"code": "def findSumOfDigits(n):\n    sum = 0\n    while n > 0:\n        sum += n % 10\n        n //= 10\n    return int(sum)\n\nN,a,b = map(int,input().split())\nc = 0\ntotal =0\nfor i in range(N+1):\n    c = findSumOfDigits(i)\n    if a <= c <= b:\n        # print(i)\n        # print(c)\n        total += i\n        # print(total)\nprint(total)", "passed": true, "time": 0.15, "memory": 14216.0, "status": "done"}, {"code": "n, a, b = map(int, input().split())\nprint(sum(i for i in range(1, n+1) if a <= sum(map(int, str(i))) <=b))", "passed": true, "time": 0.18, "memory": 14156.0, "status": "done"}, {"code": "#!/user/bin/env pypy3\nimport sys\nfrom functools import reduce\n\n\ndef fast_input():\n    return sys.stdin.readline()[:-1]\n\n\ndef digit_sum(num: int) -> int:\n    str_num = str(num)\n    return reduce(\n        lambda acc, n: acc + int(n),\n        list(str_num),\n        0\n    )\n\n\ndef solve(n: int, a: int, b: int) -> int:\n    num_sum = 0\n    for num in range(1, n + 1):\n        if a <= digit_sum(num) <= b:\n            num_sum += num\n    return num_sum\n\n\ndef main():\n    [n, a, b] = list(map(int, fast_input().split()))\n    result = solve(n, a, b)\n    print(result)\n\n\nmain()\n", "passed": true, "time": 0.15, "memory": 14168.0, "status": "done"}, {"code": "N, A, B = map(int, input().split())\n\nresult = 0\nfor i in range(1, N+1):\n    num = i//(10**4) + i//(10**3)%10 + i//(10**2)%10 + i//10%10 + i%10\n    if A <= num <= B:\n        result += i\nprint(result)", "passed": true, "time": 0.15, "memory": 14096.0, "status": "done"}, {"code": "N, A, B =list(map(int,input().split()))\n\nal = []\nfor i in range(1, N + 1):\n    checkno = 0\n\n    for j in range(len(str(i))):\n        str_i = str(i)\n        checkno += int(str_i[j])\n    if A <= checkno and checkno <= B:\n        al.append(i)\n\nprint((sum(al)))\n", "passed": true, "time": 0.26, "memory": 14352.0, "status": "done"}, {"code": "n,a,b=map(int,input().split())\nans=0\nfor i in range(n+1):\n  if a<=sum(list(map(int,list(str(i)))))<=b:\n    ans += i\nprint(ans)", "passed": true, "time": 0.15, "memory": 14120.0, "status": "done"}, {"code": "# import math\n# import statistics\n# import itertools\n# a=int(input())\n#b,c=int(input()),int(input())\n# c=[]\n# for i in a:\n#     c.append(int(i))\nN,A,B= list(map(int,input().split()))\n# f = list(map(int,input().split()))\n# g = [input().split for _ in range(a)]\n# h = []\n# for i in range(a):\n#     h.append(list(map(int,input().split())))\n# a = [[0] for _ in range(H)]#nizigen\ncount=0\nans=[]\nfor i in range(1,N+1):\n    cal=[]\n    for k in str(i):\n        cal.append(int(k))\n\n    if A<=sum(cal)<=B:\n        ans.append(i)\n        \nprint((sum(ans)))\n            \n", "passed": true, "time": 0.15, "memory": 14132.0, "status": "done"}, {"code": "# coding: utf-8\n# Your code here!\n\ndef sumDigit(x):\n  sum_ = 0\n  while x > 0:\n    sum_ += x%10\n    x //= 10\n  return sum_\n\nN,A,B=(int(x) for x in input().split())\n\nss = 0\nfor i in range(N):\n  num = sumDigit(i+1)\n  if num >= A and num <= B:\n    ss += i+1\n\nprint(ss)", "passed": true, "time": 0.15, "memory": 14284.0, "status": "done"}, {"code": "# -*- coding: utf-8 -*-\n\nn, a, b = list(map(int, input().split()))\ns = 0\nans = 0\n\ndef findSumOfDigits(num):\n    s = 0\n    while num > 0:\n        s += int(num % 10)\n        num  = int(num / 10)\n    return s\n\n\nfor i in range(n + 1):\n    s = findSumOfDigits(i)\n    if a <= s <= b:\n        ans += i\nprint(ans)\n", "passed": true, "time": 0.16, "memory": 14260.0, "status": "done"}, {"code": "N,A,B = list(map(int,input().split()))\n\ncnt = 0\nfor n in range(1,N+1):\n    val = n % 10\n    tmp = n\n    while tmp // 10 > 0:\n        \n        tmp = tmp // 10\n        val += tmp % 10\n    if val >= A and val <= B:\n        cnt += n\nprint(cnt)", "passed": true, "time": 0.23, "memory": 14076.0, "status": "done"}, {"code": "n,a,b = map(int,input().split())\nans = 0\nfor i in range(1,n+1):\n    x = list(str(i))\n    x = list(map(int,x))\n    x = sum(x)\n    if a <= x <= b:\n        ans += i\nprint(ans)", "passed": true, "time": 0.15, "memory": 14356.0, "status": "done"}, {"code": "n, a, b = map(int, input().split())\nans = 0\nfor i in range(1, n+1):\n    x = str(i)\n    cnt = 0\n    for j in range(len(x)):\n        cnt += int(x[j])\n    if a <= cnt and cnt <= b:\n        ans += i\nprint(ans)", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "n, a, b = list(map(int, input().split()))\nl = []\nc = 0\nk = 0\n\nfor i in range(n+1):\n    k = i\n    c = 0\n    while (i > 0):\n        c += i%10\n        i //= 10\n    if (a <= c <= b):\n        l.append(k)\n\nprint((sum(l)))\n", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "N, A, B = map(int, input().split())\na = list()\nfor i in range(N + 1):\n    if A <= sum(map(int, str(i))) <= B:\n        a.append(i)\nprint(sum(a))", "passed": true, "time": 0.14, "memory": 14124.0, "status": "done"}, {"code": "N, A, B = map(int, input().split())\n\nres = []\n\nfor n in range(1, N+1):\n    i = list(str(n))\n    i = [int(n) for n in i]\n    if A <= sum(i) <= B:\n        res.append(int(n))\n\nprint(sum(res))", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "n, a, b = map(int, input().split())\n\nans = 0\n\nfor i in range(n + 1):\n    l = list(map(int, str(i)))\n    sum_l = sum(l)\n    if sum_l >= a and sum_l <= b:\n        ans += i\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "N,A,B = map(int, input().split())\nsum1 = 0\nfor n in range(1, N+1):\n  sum2 = 0\n  for s in str(n):\n    sum2 += int(s)\n  if A <= sum2 <= B:\n    sum1 += n\nprint(sum1)", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "getints = lambda: map(int, input().split())\nn, a, b = getints()\nans = 0\nfor i in range(1, n+1):\n    s = str(i)\n    sum = 0\n    for c in s:\n        sum += int(c)\n    if a <= sum <= b:\n        ans += i\nprint(ans)", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "N, A, B = list(map(int,input().split()))\nans = 0\nfor i in range(N + 1):\n  i = str(i)\n  count = 0\n  for j in i:\n    count += int(j)\n  if A <= count and B >= count:\n    ans += int(i)\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14044.0, "status": "done"}, {"code": "N,A,B = map(int,input().split())\ncon = 0\nfor i in range(1 , N + 1):\n  a1 = i // 10000\n  a2 = (i - a1 * 10000)// 1000\n  a3 = (i - a1 * 10000 - a2 * 1000)// 100\n  a4 = (i - a1 * 10000 - a2 * 1000 - a3 * 100) // 10\n  a5 = i % 10\n  if A <= a1 + a2+ a3 + a4 + a5 <= B:\n    con += i\nprint(con)", "passed": true, "time": 0.14, "memory": 14192.0, "status": "done"}, {"code": "N,A,B = map(int,input().split())\ncnt = 0\nsum = 0\ni = 0\nfor i in range(N+1):\n    j = 0\n    tmpsum = 0\n    l = list(str(i))\n    for j in l:\n        tmpsum += int(j)\n    if tmpsum>=A and tmpsum <=B:\n        sum += i\nprint(sum)", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "def solve(N, A, B):\n    nums = []\n    for n in range(1, N + 1):\n        s = 0\n        ns = str(n)\n        for j in range(len(ns)):\n            s += int(ns[j])\n        if A <= s and s <= B:\n            nums.append(n)\n    print((sum(nums)))\n\n\n\ndef __starting_point():\n    N, A, B = list(map(int, input().split()))\n    solve(N, A, B)\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14360.0, "status": "done"}, {"code": "def calc_sum(num):\n    ans = 0\n    for i in range(len(str(num))):\n        target = num % 10\n        num //= 10\n        ans += target\n    return ans\n\ndef main():\n\n    n, a, b = map(int, input().split())\n    ans = 0\n    for i in range(1, n + 1):\n        num = calc_sum(i)\n        if a <= num <= b:\n            ans += i\n    print(ans)\n\ndef __starting_point():\n    main()\n__starting_point()", "passed": true, "time": 0.14, "memory": 14360.0, "status": "done"}, {"code": "N,A,B = list(map(int,input().split()))\nans = 0\nfor i in range(1,N+1):\n  M = i//10000+i%10000//1000+i%1000//100+i%100//10+i%10\n  if A <= M and M <= B:\n    ans+=i\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "n, a, b = map(int,input().split())\ncount = 0\nfor i in range(1,n+1):\n    num = i\n    digit = 0\n    while num > 0:\n        digit += num % 10\n        num = num // 10\n    if a <= digit <= b:\n        count += i\nprint(count)", "passed": true, "time": 0.23, "memory": 14272.0, "status": "done"}, {"code": "N,A,B = map(int,input().split())\n\ndef aaa(n):\n    sum = 0\n    while n > 0:\n        sum += n % 10\n        n = n//10 \n    return sum\n\nsum = 0\n\nfor i in range(1,N+1):\n    a = aaa(i)\n    if A<= a <= B:\n        sum += i\nprint(sum)", "passed": true, "time": 0.14, "memory": 14044.0, "status": "done"}, {"code": "n,a,b = map(int, input().split())\n\nans = 0\nfor num in range(n+1):\n    str_num = str(num)\n    num_list = list(str_num)\n    total = sum([int(i) for i in num_list])\n    if total >= a and total <= b:\n        ans+=num\nprint(ans)", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "N, A, B = list(map(int,input().split()))\n\ndef ten_sumfunc(n):\n    ans = 0\n    while(n>0):\n        ans += n%10\n        n = n//10\n    return ans\n\ntotal = 0\nfor i in range(N+1):\n    sum1 = ten_sumfunc(i)\n    if A <= sum1 and sum1 <= B:\n        total += i\n        \nprint(total)\n", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "#-*-coding:utf-8-*-\nimport sys\ninput=sys.stdin.readline\n\n#        tmp = list([int(i) for i in (list(str(i)))])\n\ndef main():\n    n,a,b = map(int,input().split())\n    numbers=[]\n    tmp=0\n\n    for i in range(1,n+1):\n        if i >=a and i <=b and i < 10:\n            numbers.append(i)\n        else:\n            tmp_array=list(map(int,list(str(i))))\n            if len(tmp_array) > 1:\n                for j in tmp_array:\n                    tmp+=j\n                if tmp >=a and tmp <=b:\n                    numbers.append(i)\n                tmp=0\n            else:\n                continue\n    print(sum(numbers))\n            \ndef __starting_point():\n    main()\n__starting_point()", "passed": true, "time": 0.14, "memory": 14344.0, "status": "done"}, {"code": "N, A, B = list(map(int,input().split()))\n\nans = 0\n\nfor i in range(1, N+1, 1):\n  stri = str(i)\n  sum = 0\n  for j in range(len(str(i))):\n    sum += int(stri[j])\n  else:\n    if sum >= A and sum <= B:\n      ans += i\n      \nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "\nN,A,B = map(int, input().split())\n\nans = 0\n\nfor i in range(N+1):\n    x = i%10\n    if i >= 10:\n        x += (i%100-i%10)/10\n        if i >= 100:\n            x += (i%1000-i%100)/100\n            if i >= 1000:\n                x += (i%10000-i%1000)/1000\n                if i == 10000:\n                    x=1\n    if A <= x <= B:\n        ans += i\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "def FindSumOfDigits(n):\n  Sum = 0\n  while n>0:\n    Sum += n%10\n    n //= 10\n  return Sum\n\nN, A, B = list(map(int, input().split()))\ntotal = 0\nfor i in range(N):\n  Sum = FindSumOfDigits(i+1)\n  if A <= Sum and Sum <= B:\n    total += i+1\n\nprint(total)\n", "passed": true, "time": 0.14, "memory": 14028.0, "status": "done"}, {"code": "N,A,B=map(int,input().split())\nx=y=z=a=b=sum=0\nfor i in range(1,N+1):\n    x=i%10\n    y=(i%100)//10\n    z=(i%1000)//100\n    a=(i%10000)//1000\n    b=(i%100000)//10000\n\n    if A<=x+y+z+a+b<=B:\n        sum+=i\nprint(sum)", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "n,a,b = list(map(int,input().split()))\nans = 0\nfor i in range(1,n+1):\n    temp = 0\n    c = str(i)\n    for j in range(len(c)):\n        temp += int(c[j])\n    if a <= temp and temp <= b:\n        ans += i\nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14120.0, "status": "done"}, {"code": "N,A,B = map(int, input().split())\nresult = 0\n\ndef FindSomeOfDegit(x):\n    count = 0\n    while x > 0:\n        count += x%10 \n        x = x // 10\n    return count\n\nfor i in range(N+1):\n    count = FindSomeOfDegit(i)\n    if A <= count <= B:\n        result += i\n\nprint(result)", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}]