Problem:
 Score : 200 points    Problem 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).      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 1 20 2 5      Sample Output 1 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 .       Sample Input 2 10 1 2      Sample Output 2 13       Sample Input 3 100 4 16      Sample Output 3 4554

Solution (Python):
n,a,b=map(int,input().split())
ans=0
for i in range(1,n+1):
    L=[int(i) for i in list(str(i))]
    x=sum(L)
    if a<=x<=b:
        ans+=i
print(ans)

Solution (Python):
n, a, b = map(int, input().split())

sum_ret = 0
for i in range(1, n+1):
  s = str(i)
  sum_i = 0
  for j in range(len(s)):
    sum_i += int(s[j])
  
  if sum_i >= a and sum_i <= b:
    sum_ret += i
  
print(sum_ret)

Solution (Python):
n, a, b= map(int, input().split())
ans = 0
for i in range(1, n + 1):
    tmp = i
    sum = 0
    for _ in range(5):
        sum += tmp % 10
        tmp = tmp // 10
    if a <= sum <= b:
        ans += i
print(ans)

Solution (Python):
import math
n , a , b = map(int , input().split())
total = 0
ans = 0
for i in range(1 , n + 1):
  if a <= i//10000 + (i//1000)%10 + (i//100)%10 + (i//10)%10 + i%10<= b:
    ans += i

print(ans)

Solution (Python):
N, A, B = map(int, input().split())

ans = 0


def somesum(x):
    total = 0
    while x > 0:
        total += x % 10
        x = x // 10
    return total


for i in range(N + 1):
    total = somesum(i)
    if total >= A and total <= B:
        ans += i

print(ans)

Solution (Python):
N, A, B = map(int, input().split())
ans = 0

def FindSumOfDigits(x):
    count = 0
    while x>0:
        count += x%10
        x = x//10

    return count

for n in range(1, N+1):
    count = FindSumOfDigits(n)
    if A<= count <=B:
        ans += n

print(ans)

Solution (Python):
N,A,B = map(int,input().split())
sList = [str(i) for i in range(1,N+1)]
allcount = 0
count = 0
for i in sList:
    count = 0
    for j in i:
        count += int(j)
    if A <= count <= B:
        allcount += int(i)
print(allcount)

Solution (Python):


N, A, B = map(int, input().split())
ans = 0

for i in range(1,N+1):
  n = i
  sum = 0
  while n > 0:
    sum += n % 10
    n = n // 10
  if sum >= A and sum <= B:
    ans += i
    
print(ans)

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    N,A,B=map(int,input().split())
    ans=0
    for i in range(1,N+1):
        if A<=sum(list(map(int,list(str(i)))))<=B:
            ans+=i
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
N, A, B = map(int, input().split())
ans = 0

for i in range(1,N+1):
  i_str = str(i)
  i_len = len(i_str)
  sum = 0
  for j in range(i_len):
    sum += int(i_str[j])
  if sum >= A and sum <= B:
    ans += i
    
print(ans)

Solution (Python):
n, a, b = map(int, input().split())



ans = 0
for i in range(1, n+1):
  s = str(i)
  t = 0
  for k in range(len(s)):
    t += int(s[k])
  
  if a <= t and t <= b:
    ans += i
print(ans)

Solution (Python):
n, a, b=map(int, input().split())
ans=0
for num in range(1, n+1):
    num=str(num)
    length=len(num)
    S=0
    for j in range(length):
        S+=int(num[j])
    
    if a<= S <= b:
        ans+=int(num)

print(ans)

Solution (Python):
def s(x):
    ans=0
    while True:
        ans+=x%10
        x=(x-x%10)/10
        if x==0:
            break
        
    return int(ans)

n,a,b=map(int,input().split())
    
count=0
    
for i in range(n):
    
    c=s(i+1)

    if a<=c<=b:
        count+=i+1
        
print(count)

Solution (Python):
n,a,b=map(int,input().split())

count=0

for i in range(n):
    k=0 
   
    for j in str(i+1):
        k+=int(j) 
        
    if a<=k<=b:
        count+=i+1
       
print(count)

Solution (Python):
n, a, b = map(int, input().split())
X = [i for i in range(n + 1) if a <= sum([int(j) for j in str(i)]) <= b]
print(sum(X))

Solution (Python):
input_data = list(map(int, input().split()))
n = input_data[0]
a = input_data[1]
b = input_data[2]

X = []
for i in range(a, n + 1):
    c = 0
    for j in str(i):
        c = c + int(j)
    
    if a <= c and c <= b:
        X.append(i)

print(sum(X))

Solution (Python):
N, A, B = map(int,input().split())
count = 0
for i in range(N):
    s = str(i+1)
    array = list(map(int,s))
    kei = sum(array)
    if A <= kei <= B:
        count += i+1
print(count)

Solution (Python):


import sys
input= lambda: sys.stdin.readline().rstrip()
sys.setrecursionlimit(10**9)
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
def lispin(t=int):return list(pin(t))

from collections import Counter
def resolve():
    N,A,B=pin()
    cnt=0
    for i in range(1,N+1):
        temp=str(i)
        sum=0
        for s in str(i):
            sum+=int(s)
        
        if A<=sum and sum<=B:
            
            cnt+=i
    print(cnt)

resolve()

Solution (Python):
N,A,B = map(int, input().split())
cnt = 0
res = 0
for i in range(1,N+1):
    sums = 0
    x = i
    while x > 0:
        sums += x%10
        x = x//10
    if A <= sums <= B:
        res += i
print(res)

Solution (Python):
n, a, b = map(int, input().split())

s = 0
ans = 0

for x in range(1, n+1):
    num = str(x)
    length = len(num)
    for y in range(0, length):
        s += int(num[y])
    if a <= s and s <= b:
        ans += x
    s = 0

print(ans)

Solution (Python):
s = input().split()

n = int(s[0])
a = int(s[1])
b = int(s[2])

count = 0

for i in range(1,n+1):
    s = list(str(i))
    g = 0
    for stri in s:
        g += int(stri)
    if g >= a and g <= b:
        count += i

print(count)

Solution (Python):
def decsum(i):
  ans = 0
  while(i>0):
    ans+=i%10
    i//=10
  return ans

n,a,b = tuple(map(int,input().split()))

ans = 0
for i in range(1,n+1):
  t = decsum(i)
  if a<=t and t<=b:
    ans+=i
print(ans)

Solution (Python):
N, A, B = map(int, input().split())
print(sum(i for i in range(1, N+1) if A <= sum(map(int, str(i))) <= B))

Solution (Python):
N,A,B = list(map(int,input().split()))
L = [i for i in range(1,N+1) if A <= sum(map(int,(list(str(i))))) <= B]
print(sum(L))

Solution (Python):
N, A, B = map(int, input().split())
ans = 0

for i in range(N+1):
    if A <= sum(list(map(int, list(str(i))))) <= B:
        ans += i
print(ans)

Solution (Python):
A,B,C = list(map(int,input().split()))
ans =0
for i in range(1,A+1):
    D = list(str(i))
    D = list(map(int,D))
    D = sum(D)
    if B <= D <= C:
        ans +=i
print(ans)

Solution (Python):
n,a,b=map(int,input().split())
ans=0

for i in range(n):
    i_moji=str(i+1)
    array=list(map(int,i_moji))
    if sum(array)>=a and sum(array)<=b:
        ans+=i+1

print(ans)

Solution (Python):
n, a, b = map(int, input().split(' '))

total = 0
for num in range(1, n + 1):
    digit_5 = num // 10000 % 10
    digit_4 = num // 1000 % 10
    digit_3 = num // 100 % 10
    digit_2 = num // 10 % 10
    digit_1 = num % 10
    digits = (digit_5, digit_4, digit_3, digit_2, digit_1)

    if a <= sum(digits) <= b:
        total += num

print(total)

Solution (Python):
N, A, B = map(int, input().split())
ans = 0
for i in range(1, N+1):
  n = i
  t = 0
  for j in range(1, 6):
    t += n % 10 
    n = n // 10

  if A <= t <= B:
    ans += i
print(ans)

Solution (Python):
N, A, B = map(int, input().split())
ans = 0
for i in range(1, N+1):
  n = i
  t = 0
  while n > 0:
    t += n % 10 
    n = n // 10

  if A <= t <= B:
    ans += i
print(ans)

Solution (Python):
n, a, b = map(int, input().split())
ans = 0
for i in range(1, n+1):
    l = list(str(i))
    keta = 0
    for ll in l:
        keta += int(ll)
    if a <= keta and keta <= b:
        ans += i
print(ans)

Solution (Python):
def resolve():
	n, a, b = map(int, input().split())
	ans = 0
	for i in range(1, n+1):
		v = sum(map(int, list(str(i))))
		if a <= v <= b:
			ans += i
	print(ans)
resolve()

Solution (Python):
N, A, B = map(int,input().split())
 
ans = 0
for i in range(0, N+1):
    tmp=i
    sum=0
    while(tmp>0):
        sum += tmp%10
        tmp = int(tmp/10)

    if A<=sum and sum<=B:
        ans+=i
 
print(ans)

Solution (Python):
def cal_digit_sum(x):
    res = 0
    for digit_val in str(x):
        res += int(digit_val)
    return res


def main():
    n, A, B = map(int, input().split())
    res = 0
    for i in range(1, n+1):
        res = res + (i if cal_digit_sum(i) >= A and cal_digit_sum(i) <= B else 0)
    
    print(res)

if __name__ == '__main__':
    main()

Solution (Python):
n,a,b = map(int,input().split())
ans = 0

for i in range(1,n+1):
    tmp = sum([int(x)for x in list(str(i))])
    if tmp >= a and tmp <= b:
        ans += i
print(ans)

Solution (Python):
N, A, B = list(map(int, input().split()))
ans = 0
for n in range(1, N+1):
    s = str(n)
    acc = 0
    for c in s:
        acc += int(c)
    if A <= acc <= B:
        ans += n
print(ans)

Solution (Python):
nn, min, max = map(int, input().split())
y = 0
for number in range(nn + 1):
  if min <= sum(int(n) for n in str(number)) <= max:
    y += number
print(y)

Solution (Python):
N,A,B = map(int,input().split())

cnt = 0
for i in range(1,N+1):
    n = sum(list(map(int,list(str(i)))))
    if A<=n<=B:
        cnt += i
print(cnt)

Solution (Python):

import sys

import fractions
import copy
import bisect
import math
import numpy as np
import itertools
from itertools import combinations_with_replacement


from operator import itemgetter
from sys import stdin

from operator import mul
from functools import reduce
from collections import Counter





j=0
k=0
n=3
r=1
a=[0]






"1行1つの整数を入力を取得し、整数と取得する"




"12 21 332 とか入力する時に使う"
"1行に複数の整数の入力を取得し、整数として扱う"

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

for i in number_list:
    print(number_list[i-1])

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'''
x=[]
y=[]
for i in range(N):
    x1, y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)
print(x)
print(y)
"複数行に2数値を入力する形式 x座標とy座標を入力するイメージ"
'''

'''
mixlist=[]
for i in range(N):
    a,b=input().split()
    mixlist.append((int(a),b))
print(mixlist)
"複数行にintとstrを複合して入力するやつ，今回はリスト一つで処理している"
'''

'''



"正方行列にstr型の値を入力"
'''




'''
入力
1 2
4 5
7 8
出力結果
[[1, 2], [4, 5], [7, 8]]
'''
"列数に関して自由度の高いint型の値を入力するタイプの行列"


'''
table = [[int(i) for i in input().split()] for m in range(m)]

print(type(N))
print(N)
print(type(M))
print(M)

print(type(table))
print(table)
'''











'''
入力
1234
出力
1
[[1, 2, 3, 4]]
'''




'''
word_list= input().split(" ")
print(word_list[0])
"連続文字列の入力"
"qw er ty とかの入力に使う"
"入力すると空白で区切ったところでlistの番号が与えられる"
'''



'''
A, B, C=stdin.readline().rstrip().split()
print(A)
"リストではなく独立したstr型を入れるなら以下のやり方でOK"
'''




"aという変数に入っているものを大文字にして出力"

















'''
コンビネーションの組み合わせの中身を出力する形式
for i in itertools.combinations(brray, 2)
combinationsをpermutationsにすれば順列になる
今回なら(abc133B)
入力
1 2
5 5
-2 8
出力
[[1, 2], [5, 5], [-2, 8]]
もちろん一次元リストでも使えるし
何よりiもリストのように使えるので便利
'''


'''
def cmb(n,r):
    
    r= min(n-r,r)
    
    if r == 0: return 1
    over = reduce(mul, range(n, n-r, -1))
    
    
    

    under = reduce(mul, range(1, r+1))
    
    
    
    

    return over // under
    
    
    
    
a = cmb(n, r)

'''

'''
import itertools
from itertools import combinations_with_replacement

combinationについて
以下の違いを意識しよう
combinations() p, r 長さrのタプル列、ソートされた順で重複なし

combinations_with_replacement() p, r 長さrのタプル列、ソートされた順で重複あり


使用例 　　　　　　　　　　　                  出力　　
combinations('ABCD', 2)　　　　　　　　　　　　AB AC AD BC BD CD

combinations_with_replacement('ABCD', 2)　　 AA AB AC AD BB BC BD CC CD DD
'''



'''




for i in a.most_common(n):print(i)





 


'''









'''
bisect.bisect_left(a, x, lo=0, h=len(a))
引数
a: ソート済みリスト
x: 挿入したい値
lo: 探索範囲の下限
hi: 探索範囲の上限
(lo, hiはスライスと同様の指定方法)
bisect_leftはソートされたリストaに対して順序を保ったままxを挿入できる箇所を探索します。leftが示す通り、aにすでにxが存在している場合は、挿入箇所は既存のxよりも左側になります。また、lo, hiを指定することで探索範囲を絞り込むことも可能です。デフォルトはaの全体が探索対象です。
'''

'''
素数の判定
'''


def is_prime(n):
    if n == 1: return False

    for k in range(2, int(np.sqrt(n)) + 1):
        
        if n % k == 0:
            return False
            
    return True


'''
npのmaxとmaximumの違い
xs = np.array([1, -2, 3])
np.max(xs, 0)
この出力は3となります．[1, -2, 3]と0の4つの数字のうち，最も大きい値を出力します．

一方で，[max(1, 0), max(-2, 0), max(3, 0)]を出力したい時があります．
その時は，numpyのmaximum関数を用います．

xs = np.array([1, -2, 3])
np.maximum(xs, 0)  

'''

def factorial(x, mod=10**9+7):
    
    
    
    tmp = 1
    for i in range(1, x+1):
        tmp = (tmp * i) % mod
    return tmp
    '''
    Basically, when you do a**d % n, you actually have to calculate a**d, which could be quite large.
    But there are ways of computing a**d % n without having to compute a**d itself, and that is what pow does.
    '''











def main():

    w=1
    j=0
    k=0
    
    
    
    
    
    
    DP = np.zeros(w+1, dtype=int)
    exdp=np.zeros((3,4)) 
    
    
    
        
        
    
    
        
        
    

    ans=0
    "1行1つの整数を入力を取得し、整数と取得する"
    N,A,B=map(int, input().split(" "))
    for i in range(1,N+1):
        
        a=[int(j) for j in str(i)]
        
        b=sum(a)
        if b >= A and b <= B:
            ans=ans+i
    print(ans)
        
    
    "12 21 332 とか入力する時に使う"
    "1行に複数の整数の入力を取得し、整数として扱う"
    
    


    
    
    
    '''
    入力
    1234
    出力
    [1, 2, 3, 4]
    '''
    pin_l=["x" for i in range(10)]
    

    ls = ["a", "b", "c", "d", "e"]


    
    

    
    

    
    
    
    
    
    '''
    lsというリストの場合に、1つ飛びの値を取得したい場合には
    ls[::2]
    のようにします。こうすると、
    ["a", "c", "d"]と出力される
    '''

if __name__ == "__main__":
    main()

Solution (Python):
N, A, B = map(int, input().split())
ans = 0

for n in range(1, N+1):
    n = str(n)
    n_list = list(map(int, n))

    if A <= sum(n_list) <= B:
        ans += int(n)

print(ans)

Solution (Python):
N, A, B = map(int, input().split())

print(sum(i for i in range(1,N+1) if A<= sum(map(int, str(i))) <= B))

Solution (Python):
a,b,c=map(int,input().split())
ans=0
for i in range(1,a+1):
  count=0
  s=str(i)
  for j in s:
    count+=int(j)
  if b<=count<=c:
    ans+=i
print(ans)

Solution (Python):
n,a,b = map(int,input().split())
t = 1
ans = 0
while t <=n:
  s = sum(list(map(int, str(t))))
  if a <= s <= b:
    ans += t
  t += 1
print(ans)

Solution (Python):
N, A, B = list(map(int,input().split()))
list = []
totalsum=0
for i in range(N+1):
    n = len(str(i))
    sum = 0
    for j in range(n):
        sum += int(str(i)[j])
    if A <= sum <= B:
        totalsum += i
print(totalsum)

Solution (Python):
n,a,b = map(int, input().split())

ans = 0
for i in range(1,n+1):
  num = i
  N = 0
  while i > 9:
    N += i%10
    i //= 10
  N += i
  
  if a <= N <= b:
    ans += num
    
print(ans)

Solution (Python):
n,a,b = map(int, input().split())
res = 0
for i in range(1,n+1):
  tmp = 0
  for j in range(len(str(i))):
    tmp += int(str(i)[j])
  if a <= tmp <= b:
    res += i
print(res)

Solution (Python):
n,a,b = map(int,input().split())
sums = 0
for i in range(1,n+1):
  if a<= i//10000+(i%10000)//1000+(i%1000)//100+(i%100)//10+i%10 <= b:
    sums += i
print(sums)

Solution (Python):
n, a, b = map(int, input().split())

counter = 0
for i in range(1, n+1):
    j = list(str(i))
    l = 0
    for k in j:
        l += int(k)
    if a <= l and b >= l:
        counter += i
print(counter)

Solution (Python):

import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
from string import ascii_lowercase, ascii_uppercase, digits
sys.setrecursionlimit(10**7)
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
PI = math.pi

N, A, B = ri_()
ans = 0
for num in range(1, N + 1):
    sm = 0
    for i in str(num):
        sm += int(i)
    if A <= sm <= B:
        ans += num
print(ans)

Solution (Python):
n,a,b = input().split()
n = int(n)
a = int(a)
b = int(b)

def digitSum(n):
    s = str(n)
    array = list(map(int, s))
    return sum(array)

ans = int(0)

for i in range(1, n+1):
    if digitSum(i) >= a and digitSum(i) <= b:
        ans += i
print(ans)

Solution (Python):
n,a,b = map(int, input().split())
cnt = 0

def digidsum(x):
  s = str(x)
  array_list = list(map(int,s))
  return sum(array_list)



for i in range(n):

  if digidsum(i+1) >= a and digidsum(i+1) <= b:
    cnt += i+1
    
print(cnt)

Solution (Python):
n, a, b = map(int, input().split())

ans = 0
for i in range(1, n+1):
    s = str(i)
    if a <= sum(int(x) for x in s) <= b:
        ans += i
print(ans)

Solution (Python):
n,a,b=map(int,input().split())
ss=0
for i in range(1,n+1):
    s=0
    k=str(i)
    for j in range(len(k)):
        s+=int(k[j])
    if s>=a and s<=b:
        ss+=i
print(ss)

Solution (Python):
n, a, b = map(int, input().split())

ans = 0
for i in range(1, n+1):
  tmpsum = 0
  for s in str(i):
    tmpsum += int(s)
  if tmpsum >= a and tmpsum <= b:
    ans += i

print(ans)

Solution (Python):
import sys
def main():
    input = sys.stdin.readline()
    N, A, B = map(int,input.split())
    

    answer = []
    for i in range(N+1):
        s = sum( map(int,list(str(i)) )) 
        if s >= A and s <= B: answer.append(i)
        
    print(sum(answer))

if __name__ == "__main__":
    main()

Solution (Python):
n, a, b= map(int, input().split())
print(sum(i for i in range(n + 1) if a <= sum(map(int, str(i))) <= b))

Solution (Python):
def main():
    N, A, B = map(int,input().split())
    

    answer = []
    for i in range(N+1):
        s = sum( map(int,list(str(i)) )) 
        if s >= A and s <= B: answer.append(i)
        
    print(sum(answer))

if __name__ == "__main__":
    main()

Solution (Python):
N,A,B=map(int,input().split())
ssum=0
for i in range(1,N+1):
	listi=[0,0,0,0,0]
	temp=i
	for j in range(5):
		listi[j]=temp%10
		temp=(temp-temp%10)/10
	sumi=sum(listi)
	if(sumi>=A and sumi<=B):
		ssum=ssum+i
print(ssum)

Solution (Python):
N,A,B = list(map(int,input().split()))

def findSumOfDigits(n):
    s = 0
    while n>0:
        s += n%10
        n //= 10
    return s 

total = 0
for i in range(1,N+1):
    if A <= findSumOfDigits(i) <= B:
        total += i
print(total)

Solution (Python):
def sum_each(n):
    s = 0
    while n != 0:
        s += n % 10
        n = n//10
    return s


n, a, b = map(int, input().split())
s = 0
for i in range (1, n+1):
    if a <=sum_each(i) and sum_each(i) <= b:
        s = s + i
print(s)

Solution (Python):
n, a, b = map(int,input().split())

sum = 0
for i in range(n+1):
  s = str(i)
  wa = 0
  for j in range(len(s)):
    wa += int(s[j])
  if a <= wa and wa <= b:
    sum += i
    
print(sum)

Solution (Python):
n,a,b = map(int,  input().split())
print(
    sum(
        i for i in range(n+1)
            if a<=sum(map(int, list(str(i)))) and sum(map(int, list(str(i))))<=b
    )
)

Solution (Python):
N, A, B = (int(i) for i in input().split())

all_num = 0

for i in range(1, N + 1):

    str_i = str(i)

    total_i = list(map(int, str_i))

    x = sum(total_i)

    if A <= x <= B:
        all_num += i

print(all_num)

Solution (Python):
def main():
    N, A, B  = map(int, input().split())
    sum_v = 0
    for i in range(1, N+1):
        v = sum([int(s) for s in str(i)])
        if v >= A and v <= B:
            sum_v += i
    print(sum_v)

if __name__ == '__main__':
    main()

Solution (Python):
n, a, b = map(int, input().split())
ans = []
for i in range(1, n+1) :
    one = [int(x) for x in list(str(i))]
    ans.append(sum(one))
co = 0
for d, s in enumerate(ans):
    if a <= s <= b :
        co += (d + 1)
print(co)

Solution (Python):
def calc_sum(num):
    sum_value = 0
    while True:
        if num != 0:
            sum_value += (num % 10)
            num //= 10
        else:
            return sum_value


N, A, B = [int(n) for n in input().split()]
count = 0
for n in range(1, N+1):
    if A <= calc_sum(n) <= B:
        count += n
print(count)

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n,a,b=map(int, input().split())
    ans=0
    for i in range(1,n+1):
        cnt=0
        if a<=sum([int(j) for j in str(i)])<=b:
            ans+=i
    print(ans)
resolve()

Solution (Python):

import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n,a,b=map(int, input().split())
    ans=0
    for i in range(1,n+1):
        cnt=0
        for j in str(i):
            cnt+=int(j)
        if a<=cnt<=b:
            ans+=i
    print(ans)
resolve()

Solution (Python):
n, a, b = map(int, input().split())
total = 0

for i in range(n+1):
    if a <= sum(map(int, list(str(i)))) <= b:
        total += i

print(total)

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n,a,b=map(int, input().split())
    l=[]
    for i in range(1,n+1):
        cnt=0
        for j in range(len(str(i))):
            cnt+=int(str(i)[j])
        if a<=cnt<=b:
            l.append(i)
    print(sum(l))
resolve()

Solution (Python):
N, A, B = map(int, input().split())
total = 0
for n in range(1, N + 1):
    if A <= sum(map(int, list(str(n)))) <= B:
        total += n
print(total)

Solution (Python):
N, A, B = map(int,input().split())
lst_1 = []
def digitSum(n):
    
    s = str(n)
    
    array = list(map(int, s))
    
    return sum(array)

sub = [k for k in range(1,N+1)]

for j in sub:
    if A <= digitSum(j) <= B:
        lst_1.append(j)
print(sum(lst_1))

Solution (Python):
N,A,B=map(int,input().split())

ans=0
for n in range(1,N+1):
    d=list(map(int,list(str(n))))
    if A<=sum(d)<=B:
        ans+=n
print(ans)

Solution (Python):
N, A, B = map(int,input().split())
print(sum(i for i in range(1, N+1) if A <= sum(map(int, str(i))) <= B))

Solution (Python):
N, A, B = map(int,input().split())

result = 0
for n in range(1,N+1):
    sm = 0
    for i in range(len(str(n))):
        sm += int(str(n)[i])
    if A<=sm<=B:
        result += n

print(result)

Solution (Python):
n,a,b=map(int,input().split())
k=0
for i in range(1,n+1):
  if a<=sum(list(map(int, str(i))))<=b:
    k+=i
print(k)

Solution (Python):
li = input().split()
N = li[0]
A = li[1]
B = li[2]
N = int(N)
A = int(A)
B = int(B)
out = 0

for i in range(N+1):
    tmp = 0
    i_ori = i
    s = str(N)
    for j in range(len(s)):
        tmp += i%10
        i = i//10
    if (tmp <= B and tmp >= A):
        out += i_ori

print(out)

Solution (Python):
n,a,b=map(int,input().split())
ans=0
for l in range(1,n+1):
    ls=str(l)
    q=sum([int(ls[i]) for i in range(len(ls))])
    if a<=q and q<=b: ans+=l
print(ans)

Solution (Python):
n, a, b = map(int, input().split())
ans = 0

for i in range(1, n + 1):
    if a <= sum(map(int, list(str(i)))) <= b:
        ans += i

print(ans)

Solution (Python):
import sys
input = lambda: sys.stdin.readline().strip()

def main():
    N, A, B = map(int, input().split())

    all_sum = 0
    for i in range(1,N+1):
        keta_sum = sum(list(map(int, str(i))))
        if keta_sum >= A and keta_sum <= B:
            all_sum += i
    print(all_sum)

main()

Solution (Python):
n,a,b = map(int,input().split())
ans = 0

for i in range(n+1):
    if a <= sum(list(map(int,list(str(i))))) <= b:
        ans += i
print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,sqrt
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7


def ktw(x):
    return sum(list(map(int,list(str(x)))))
n,a,b=MI()
ans=0
for i in range(1,n+1):
    if a<=ktw(i)<=b:
        ans+=i
print(ans)

Solution (Python):
n, a, b = map(int, input().split())
ans = 0

def calculate_digit_sum(n):
    digit_sum = 0
    for digit in str(n):
        digit_sum += int(digit)
    return digit_sum

for num in range(1, n + 1):
    
    if a <= calculate_digit_sum(num) and calculate_digit_sum(num) <= b:
        ans += num
print(ans)

Solution (Python):
def readinput():
    n,a,b = list(map(int,input().split()))
    return n,a,b

def sumdigit(n):
    sum=0
    t = getdigits(n)
    
    for n in t:
        sum+=n
    return sum

def getdigits(n):
    if (n==10000):
        return (1,0,0,0,0)
    
    d4 = n // 1000
    n -= d4*1000
    d3 = n // 100
    n -= d3*100
    d2 = n // 10
    n -= d2*10
    return (d4,d3,d2,n)

def main(n,a,b):
    sum=0
    for i in range(1,n+1):
        s = sumdigit(i)
        
        if (a<=s and s<= b):
            sum += i
    return sum

if __name__ == '__main__':
    n,a,b = readinput()
    sum = main(n,a,b)
    print(sum)

Solution (Python):
N, A, B = map(int, input().split())

sum_som = 0
for i in range(1, N + 1):
    if A <= (sum(list(map(int, list(str(i)))))) <= B:
        sum_som = sum_som + i

print(sum_som)

Solution (Python):
n,a,b = map(int, input().split())
ans = 0
for i in range(n+1):
    if a <= sum(list(map(int, list(str(i))))) <= b:
        ans += i
print(ans)

Solution (Python):
a,b,c=map(int,input().split())
d=[]
for i in range(a+1):
    if b<=sum(list(map(int, str(i))))<=c:
        d.append(i)
    else:
        continue
print(sum(d))

Solution (Python):
def resolve():
    
    
    
    n, a, b = list(map(int, input().split()))
    
    
    
    
    
    

    re = 0
    for i in range(1, n+1):
        sumNum = (i // 10000) + ((i % 10000) // 1000) + ((i % 1000) // 100) + ((i % 100) // 10) + (i % 10)
        if sumNum >= a and sumNum <= b:
            re += i

    print(re)
resolve()

Solution (Python):
from sys import stdin


def find_sum_of_digits(n, base=10):
    _sum = 0
    while n>0:
        _sum += n%base
        n //= base
    return _sum


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    N, A, B = list(map(int,_in[0].split(' ')))  
    
    cnt = 0
    for n in range(1,N+1):
        _sum = find_sum_of_digits(n)
        if A <= _sum <= B:
            cnt += n
    
    print(cnt)

Solution (Python):
from sys import stdin


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    N, A, B = list(map(int,_in[0].split(' ')))  
    
    cnt = 0
    for n in range(N+1):
        _sum = sum(list(map(int,list(str(n)))))
        if A <= _sum <= B:
            cnt += n
    
    print(cnt)

Solution (Python):
n, a, b = map(int, input().split())
ans = 0
for i in range(1, n+1):
    tmp = 0
    for j in str(i):
        tmp += int(j)
    if a<=tmp<=b:
        ans += i
print(ans)

Solution (Python):
N, A, B = map(int, input().split())
OutPut = 0

for i in range(1,N+1):
  moji = str(i)    
  leng = len(moji) 
  
  S = 0
  for j in range(leng):
    S += int(moji[j])
  
  if S >= A and S <= B:
    OutPut += i
    
print(OutPut)

Solution (Python):
N, A, B = map(int, input().split())
sum_number = 0

for i in range(N + 1):
    actual = sum(map(int, str(i)))
    if actual >= A and actual <= B:
        sum_number += i

print(sum_number)

Solution (Python):
n, a, b = [int(x) for x in input().split()]
total = 0
for i in range(1, n + 1):
    t = sum(map(int,list(str(i))))
    if a <= t <= b:
        total += i
    t = 0
print(total)

Solution (Python):
n, a, b = [int(x) for x in input().split()]
sum = 0
t = 0
for i in range(1, n + 1):
    for j in str(i):
        t += int(j)
    if a <= t <= b:
        sum += i
    t = 0
print(sum)

Solution (Python):
N, A, B = map(int, input().split())

ans = 0
for i in range(N+1):
    stri = str(i)
    sumi = 0
    for j in range(len(stri)):
        sumi += int(stri[j])
    if A <= sumi <= B:
        ans += i

print(ans)

Solution (Python):
n, a, b = map(int, input().split())
ans = 0

for i in range(1, n+1):
    s = 0
    num = i
    while num > 0:
        s = s + num % 10
        num = num // 10
    if a <= s <= b:
        ans = ans + i
print(ans)

Solution (Python):
N, A, B = map(int, input().split())

ans = 0


def keta_sum(num):
	sum = 0
	while num:
		sum += num % 10
		num = num // 10
    
	return sum

for i in range(N):
	num = i + 1
	sum = keta_sum(num)
	if (sum >= A) and (sum <= B):
		ans += num

print(ans)

Solution (Python):
l = list(map(int, input().split()))

total = 0
sum = 0
for i in range(1, l[0] + 1):
  sum = 0
  n = i
  while i > 0:
    sum += i % 10
    i //= 10
  if sum >= l[1] and sum <= l[2]:
    total += n

print(total)

Solution (Python):
n, a, b = map(int, input().split())
cnt = 0
for i in range(1, n+1):
    if a <= sum(list(map(int, list(str(i))))) <= b:
        cnt += i
print(cnt)

Solution (Python):
n,a,b = map(int, input().split())
total = 0
for i in range(1,n+1):
  t = 0
  for s in str(i):
    t += int(s)
  if (t >= a) & (t <= b):
    total += i
print(total)

Solution (Python):

"""this is python work script"""

def sum_digits(i):
    """return sum input digits"""
    str_i = str(i)
    list_i = list(map(int, str_i))
    sum_list = sum(list_i)

    return sum_list

def solve(N, num_min, num_max):
    """solve problem"""
    result = 0
    for i in range(1, N+1):
        sum_d = sum_digits(i)
        if num_min <= sum_d <= num_max:
            result += i
    return result

def main():
    """main method"""
    N, A, B = list(map(int, input().split(' ')))
    answer = solve(N, A, B)
    print(answer)

if __name__ == '__main__':
    main()

Solution (Python):
n , a , b = map(int,input().split())
ans = 0
for i in range(1,n+1):
    kar = 0
    s = str(i)
    for j in range(len(s)):
        kar += int(s[j])
    
    if a <= kar <= b:
        ans += i
print(ans)

Solution (Python):

"""this is python work script"""

def sum_digits(i):
    """return sum input digits"""
    sum_tmp = 0
    quotient = i

    for _ in range(5):
        quotient, mod = divmod(quotient, 10)
        sum_tmp += mod
        if quotient == 0:
            break
    return sum_tmp

def solve(N, num_min, num_max):
    """solve problem"""
    result = 0
    for i in range(1, N+1):
        sum_d = sum_digits(i)
        if num_min <= sum_d <= num_max:
            result += i
    return result

def main():
    """main method"""
    N, A, B = list(map(int, input().split(' ')))
    answer = solve(N, A, B)
    print(answer)

if __name__ == '__main__':
    main()