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

in_N,A,B = map(int,input().split())

count = 0
for i in range(in_N +1):
    sum_all = 0
    i_str = str(i)
    for j in range(len(i_str)):
        sum_all += int(i_str[j])
    if A<=sum_all:
        if sum_all<=B:
            count += i
            
print(count)

Solution (Python):

input_N,A,B = input().split()
A = int(A)
B = int(B)

count = 0
for i in range(int(input_N)+1):
    sum_all = 0
    i_str = str(i)
    for j in range(len(i_str)):
        sum_all += int(i_str[j])
    if A<=sum_all:
        if sum_all<=B:
            count += i
            
print(count)

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

Solution (Python):

input_all = input()
input_N = input_all.split()[0] 
A,B = int(input_all.split()[1]),int(input_all.split()[2]) 

count = 0
for i in range(int(input_N)+1):
    sum_all = 0
    i_str = str(i)
    for j in range(len(i_str)):
        sum_all += int(i_str[j])
    if A<=sum_all:
        if sum_all<=B:
            count += i
print(count)

Solution (Python):

input_all = input()
input_N = input_all.split()[0] 
A,B = int(input_all.split()[1]),int(input_all.split()[2]) 
input_list = [int(input_N[i]) for i in range(len(input_N))]

e = input_list[-1]
if len(input_list)>1:
    d = input_list[-2]
    if len(input_list)>2:
        c = input_list[-3]
        if len(input_list)>3:
            b = input_list[-4]
            if len(input_list)>4:
                a = input_list[-5]

count = 0
for i in range(int(input_N)+1):
    sum_all = 0
    i_str = str(i)
    for j in range(len(i_str)):
        sum_all += int(i_str[j])
    if A<=sum_all:
        if sum_all<=B:
            count += i
print(count)

Solution (Python):
N, A, B = map(int, input().split())
nums = []
for i in range(1,N+1):
    I = str(i)
    s = 0
    for j in range(len(I)):
        s += int(I[j])
    if s >= A and s <= B:
        nums.append(i)
print(sum(nums))

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

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

print(ans)

Solution (Python):
N, A, B = map(int, input().split())
total = 0
for n in range(1, N + 1):
    i = n
    num = 0
    while n > 0:
        w = n % 10
        n = n // 10
        num += w
    if num >= A and num <= B:
        total += i
print(total)

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

total = 0

for n in range(1, N + 1):
    i = n
    num = 0
    while n > 9:
        w = n % 10
        n = n // 10
        num += w
    num += n
    if num >= A and num <= B:
        total += i

print(total)

Solution (Python):


N, A, B = [int(i) for i in input().split()]

all_sum = 0
for i in range(1, N+1):

    i_sum =sum(list(map(int, str(i))))
    if A <= i_sum and i_sum <= B:
        all_sum += i
print (all_sum)

Solution (Python):
n, a, b = map(int, input().split())
ans = 0
for i in range(1, n+1):
  value = i
  key = 0
  while value > 0:
    key += value%10
    value //= 10
  if a <= key <= b:
    ans += i
print(ans)

Solution (Python):
def resolve():
    N, A, B = list(map(int, input().split(" ")))
    res = 0
    for i in range(1, N+1):
        val = 0
        for s in str(i):
            val += int(s)
        if A <= val and val <= B:
            res += i
    print(res)


if '__main__' == __name__:
    resolve()

Solution (Python):
icase=0
if icase==0:
    n,a,b=map(int,input().split())
    nsum=0
    for i in range(1,n+1):
        nn=sum([int(ii) for ii in list(str(i))])

        if a<=nn and nn<=b:
            nsum=nsum+i
    print(nsum)

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

tot=0
for i in range(N+1):
    ketat=0
    ketat+=i//1e4 
    ketat+=(i%1e4)//1e3 
    ketat+=(i%1e3)//1e2 
    ketat+=(i%1e2)//1e1 
    ketat+=i%10 
    
    if ketat>=A and ketat<=B:
        tot+=i
print(tot)

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

ans = 0

for i in range(1,N+1):
    sm = 0
    for j in str(i):
        sm += int(j)

    if A <= sm <= B:
        ans += i

print(ans)

Solution (Python):
num = input().split()
total = 0
for i in range(1,int(num[0])+1):
    count = 0
    i_num = str(i)
    for j in range(len(i_num)):
        count += int(i_num[j])
    if count >= int(num[1]) and count <= int(num[2]):
        total += i
print(total)

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

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

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

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

print(ans)

Solution (Python):

import io

n, m, k = map(int, input().split())
counter = 0
for i in range(1, n+1):
    if m <= sum([int(j) for j in str(i)]) <= k:
        counter += i
print(counter)

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

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

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

print(ans)

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

for i in range(1, N + 1):
    total = 0
    j = i
    while j != 0:
        total += j % 10
        j = j // 10
    if A <= total <= B:
        All += i

print(All)

Solution (Python):
N, A, B = map(int, input().split())
Total = 0
for i in range(1, N + 1):
    total = 0
    str_i = str(i)
    len_i = len(str_i)
    for l in range(len_i):
        total += int(str_i[l])
    if A <= total <= B:
        Total += i
print(Total)

Solution (Python):
n,a,b =map(int,input().split())
def f(x):
    sum = 0
    for i in str(x):
        sum += int(i)
    return sum
data = []
for i in range(1,n+1):
    if a <= f(i) <= b:
        data.append(i)
print(sum(data))

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

Solution (Python):

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

for i in range(1,n+1):
    l = []
    l = list(str(i))
    l_in = [int(j) for j in l]

    if a <= sum(l_in) <= b:
        total += i

print(total)

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

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

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

print(ans)

Solution (Python):
def getKetaSum(val):
    sum = 0
    while val != 0:
        sum += val % 10
        val //= 10
    return sum

N,A,B = map(int, input().split())
ans = 0
for i in range(1, N + 1):
    sum = getKetaSum(i)
    if A <= sum and sum <= B:
        ans += i

print(ans)

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):
n,a,b = map(int,input().split())
ttl = 0

for i in range(1,n+1):
  nums = sum(list(map(int,str(i)[:])))
  if nums >= a and nums <= b:
    ttl += i

print(ttl)

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

Solution (Python):
input_string = input().split(" ")
n = int(input_string[0])
a = int(input_string[1])
b = int(input_string[2])
numbers_generated_by_n_list = []
numbers_between_a_and_b_sum = 0

for val in range(1, n+1):
  fixed_a = list(str(val))
  fixed_a_list = list(map(int,fixed_a))
  fixed_a_list_sum = sum(fixed_a_list)
  numbers_generated_by_n_list.append(fixed_a_list_sum)

for index, val in enumerate(numbers_generated_by_n_list):
  if val >= a and val <= b:
    numbers_between_a_and_b_sum += (index+1)

print(numbers_between_a_and_b_sum)

Solution (Python):
from sys import stdin
import math

def dgtsum(x):
    if(x==0):
        return 0
    return x%10+dgtsum(x//10)

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

print(ans)

Solution (Python):
def main():
    N, A, B = map(int, input().split())
    s = 0
    for i in range(1, N+1):
        ss = 0
        num = str(i)
        for j in range(len(num)):
            ss += int(num[j])
        if A <= ss <= B:
            s += i
    print(s)
main()

Solution (Python):
N,A,B = map(int,input().split())
s = 0
j = 0
for i in range(1,N+1):
  j = i
  x0 = j // 10000
  j -= x0 * 10000
  x1 = j // 1000
  j -= x1 * 1000
  x2 = j // 100
  j -= x2 * 100
  x3 = j // 10
  j -= x3 * 10
  x4 = j
  if (A <= x0 + x1 + x2 + x3 + x4 and B >= x0 + x1 + x2 + x3 + x4):
    s += i
print(s)

Solution (Python):
def myAnswer(N:int,A:int,B:int) -> int:
   result = 0
   for i in range(1,N+1):
      string = list(str(i))
      total=sum([int(s) for s in string]) 
      if(A<=total and total <= B):
         result +=i
   return result


def modelAnswer():
   tmp=1
def main():
   N,A,B = map(int,input().split())
   print(myAnswer(N,A,B))


if __name__ == '__main__':
   main()

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

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

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

x = 0
for n in range(1, N+1):
    n_sum = 0
    for i in str(n):
        n_sum += int(i)
    if A <= n_sum <= B:
        x += n
print(x)

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

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

cnt=0
for i in range(1,n+1):
    k=str(i)
    l=0
    for j in range(len(k)):
        l+=int(k[j])
    if a<=l and l<=b:
        cnt+=int(k)

print(cnt)

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

ans = 0
for i in range(N+1):
    str_number = list(str(i))
    str_number = list(map(lambda x: int(x), str_number))
    s = sum(str_number)
    if s >= A and s <= B:
        ans += i

print(ans)

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

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

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

def total_devision(j):
    sum=0
    while j>0:
        sum+=int(j%10)
        j=int(j/10)
    return sum

total_2=0
for i in range(n+1):
    total=total_devision(i)
    if a<=total<=b:
        total_2+=i

print(total_2)

Solution (Python):

n, a, b = [int(s) for s in input().split()]
total = 0

for k in range(1, n + 1):
    tmp = sum([int(s) for s in list(str(k))])
    if a <= tmp <= b:
        total += k

print(total)

Solution (Python):
import collections
import sys
import numpy as np
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
MOD = 10**9+7
import itertools
import math

n,a,b = map(int,input().split())
cnt = 0
ans = 0
for i in range(1,n+1):
    c = str(i)
    c_sum = 0
    for j in range(len(c)):
        c_sum += int(c[j])
    if c_sum>= a and c_sum<=b:
        ans += i
print(ans)

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

S = 0

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

print(S)

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

result_sum = 0
for n in range(1, N + 1):
    num = sum(map(lambda x: int(x), str(n)))
    if A <= num <= B:
        result_sum += n
print(result_sum)

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):
import math

temp = input().split()
n = int(temp[0])
a = int(temp[1])
b = int(temp[2])

def digitsSum(num):
    sum = 0
    while num > 0:
        sum += num % 10
        num = math.floor(num/10)
    return sum

answer = 0
for i in range(1,n+1):
    s = digitsSum(i)
    if a <= s <= b:
        answer += i

print(answer)

Solution (Python):

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

for i in range(1, N + 1):
	sum = 0
	
	for c in str(i):
		sum += int(c)
	
	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):
    v = sum(list(map(int, list(str(i)))))
    if A <= v <= B:
        ans += i
print(ans)

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

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

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

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

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

Solution (Python):

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

def calc_sum(i):
    ret = 0
    while i != 0:
        ret += i % 10
        i //= 10
    return ret

for i in range(1, n + 1):
    sum = calc_sum(i)
    if a <= sum and sum <= b:
        ans += i

print(ans)

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


def test(a):
    t = 0
    while a > 0:
        t += a % 10
        a //= 10

    return t


for i in range(1, n + 1):
    c = test(i)
    if c >= a and c <= b:
        total += i

print(total)

Solution (Python):


N, A, B = map(int, input().split())
sumn = 0
sumans = 0
for n in range(1,N+1):
    Ns = str(n)
    sumn = 0
    for i in range(len(Ns)):
        sumn = sumn + int(Ns[i])
    if A <= sumn and sumn <= B:
        sumans = sumans + n
print(sumans)

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

ans = 0
for i in range(1, N + 1):
    S = str(i)
    res = sum([int(s) for s in S])
    if (A <= res and res <= B):
        ans += i

print(ans)

Solution (Python):
n,a,b =map(int,input().split())
ans = 0
for i in range(1,n+1):
    x = str(i)
    res = 0
    for p in x:
        res+=int(p)
    if res >=a and res <=b:ans+=i
print(ans)

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

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

print(ans)

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

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

print(ans)

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

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

ans = 0
for i in range(n + 1):
    tmp = 0
    for j in str(i):
        tmp += int(j)
        if tmp > b:
            break
    if tmp <= b and tmp >= a:
        ans += i

print(ans)

Solution (Python):
a, b, c = map(int, input().split())
total = 0
for i in range(1, a + 1):
  d = str(i)
  e = list(d)
  sum = 0
  for j in e:
    sum += int(j)
  if ((sum >= int(b)) & (sum <= int(c))):
    total += i
print(total)

Solution (Python):
def SumOfTheDigit(n):
	sum=0
	while not n==0:
		mod = n%10
		sum = sum + mod
		n = n//10
	return sum

N,A,B = map(int,input().split())
ans = 0
for i in range(N+1):
	test = int(SumOfTheDigit(i) )
	if A <= test <=B:
		ans = ans + i
print(ans)

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

sum_out = 0

for i in range(1, a+1):
    d = str(i)
    keta = len(d)

    sum_a = 0
    for j in range(keta):
        sum_a += int(d[j])

    if b <= sum_a & sum_a <= c:
        sum_out += i

print(sum_out)

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

ans = 0
for i in range(1, n + 1):
    ii = str(i)
    ii = list(ii)
    sub = 0
    for j in ii:
        sub += int(j)
    if sub >= a and sub <= b:
        ans += i

print(ans)

Solution (Python):



import sys









def II(): return int(sys.stdin.readline())


def MI(): return map(int, sys.stdin.readline().split())





def LI(): return list(map(int, sys.stdin.readline().split()))


def LLI(rows_number): return [LI() for _ in range(rows_number)]


def sumDigit(inputNum):
    result = 0
    numString = str(inputNum)
    for j in range(0, len(numString), +1):
        result = result + int(numString[j])
    return result


def solver(maxNumber, fromNum, toNum):
    result = 0
    for j in range(1, maxNumber+1, +1):
        nowDigitSum = sumDigit(j)
        if fromNum <= nowDigitSum:
            if nowDigitSum <= toNum:

                result = result + j
    return result


if __name__ == "__main__":
    N, A, B, = MI()
    print("{}".format(solver(N, A, B)))

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

Solution (Python):
from functools import reduce
from operator import add

N, A, B = map(int, input().split())
t = 0
for n in range(1, N+1):
    m = reduce(add, map(int, list(str(n))))
    if A <= m <= B:
        t += n
print(t)

Solution (Python):
if __name__ == "__main__":
    N, A, B = map(int, input().split())
    ans = 0
    for i in range(1, N+1):
        x = sum(list(map(int, str(i))))
        
        if A <= x and x <= B:
            
            ans += i
    print(ans)

Solution (Python):
def colsum(n):
    ret = 0
    num = n
    while num >= 10:
        ret += num%10
        num //= 10
    ret += num
    return ret

def iim():return map(int,input().split())

n,a,b = iim()
cnt = 0
for i in range(1,n+1):
    if a <= colsum(i) <= b:
        cnt += i
print(cnt)

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

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

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

ans = 0

for i in range(1,N+1):
    tmp = str(i)
    wa = 0
    for j in tmp:
        wa += int(j)
    if A <= wa and wa <= B:
        ans += i
        
print(ans)

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


lines = 1
inp = list()

for _ in range(lines):
    inp.append(sys.stdin.readline().strip())

inp = inp[0].split()
n = int(inp[0])
a = int(inp[1])
b = int(inp[2])

result = 0

for i in range(n+1):
    s = sum([int(j) for j in str(i)])
    if a <= s <= b:
        result += i

print(result)

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

print(ans)

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

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

for i in range(1,n+1):
  for j in range(len(str(i))):
    num.append(str(i)[j])
    
  number=[int(j) for j in num]
  number=sum(number)
  
  if number>=a and number<=b:
    ans+=i
    
  num,number=[],[]
  
print(ans)

Solution (Python):
N,A,B = map(int,input().split())
tmp = 0
x = 0
s = 0
for n in range(1,N+1):
  x = n
  tmp = 0
  while (x > 0):
    tmp = tmp + (x % 10)
    x = x // 10
  if (A <= tmp <= B):
    s = s + n
print(str(s))

Solution (Python):
n,a,b=[int(i) for i in input().split()]

def check(n):
    each=list(str(n))
    total=0
    for i in each:
        total+=int(i)
    if total>=a and total<=b:
        return True
    return False

ans=0
for i in range(1,n+1):
    if check(i):
        ans+=i
print(ans)

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

		count += i
 
print(count)

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

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

ans = 0
for x in range(n+1):
    x_1 = x%10
    x_2 = (x%100)//10 + x_1
    x_3 = (x%1000)//100 + x_2
    x_4 = (x%10000)//1000 + x_3
    x_5 = (x%100000)//10000 + x_4
    if a<=x_1 and x_1<=b and x<10:
       ans += x
    if a<=x_2 and x_2<=b and 10<=x and x<100:
       ans += x
    if a<=x_3 and x_3<=b and 100<=x and x<1000:
       ans += x
    if a<=x_4 and x_4<=b and 1000<=x and x<10000:
       ans += x
    if a<=x_5 and x_5<=b and 10000<=x and x<=100000:
       ans += x

print(ans)

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

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

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

for i in range(n):
  sum = 0
  check = i + 1
  while (check > 0):
    sum = sum + check % 10
    check = check // 10
  
  if sum >= a:
    if sum <= b:
      count += (i+1)
      
print(count)

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

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

print(cnt)

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

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

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

print(ans)

Solution (Python):
if __name__ == "__main__":
    n, a, b = map(int, input().split())

    ans = 0

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

    print(ans)

Solution (Python):
def digit_sum(n):
    res = 0
    while n > 0:
        res += n % 10
        n //= 10
    return res


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

res = 0
for i in range(1, n + 1):
    if a <= digit_sum(i) <= b:
        res += i
print(res)

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

ans = 0
for n in range(N+1):
  if digitSum(n)>=A and digitSum(n)<=B:
    ans += n
    
print(ans)

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

def solve(n):
    if n == 0:
        return 0
    else:
        temp = n % 10
        return temp + solve(n // 10)

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

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

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

ans = 0

for i in range(1, N+1):
    x = i
    judg = 0
    for ii in range(len(str(i))):
        judg += (x % 10)
        x = x // 10    
    if A<=judg and B>=judg:
        ans += i

print(ans)

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

for n in range(1,N+1):
    lis=list(str(n))
    lis=map(int,lis)
    tmp=sum(lis)
    if(A<= tmp and B >= tmp):
        total+=n
print(total)

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

ans = 0
for i in range(N+1):
    q = i
    jdg = 0
    for k in range(5):
        jdg += q%10
        q //= 10
    if A <= jdg and jdg <=B:
        ans += i
print(ans)

Solution (Python):
from itertools import permutations
import sys

sys.setrecursionlimit(10 ** 6)
from bisect import *
from collections import *
from heapq import *

def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def SI(): return sys.stdin.readline()[:-1]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
int1 = lambda x: int(x) - 1
def MI1(): return map(int1, sys.stdin.readline().split())
def LI1(): return list(map(int1, sys.stdin.readline().split()))
p2D = lambda x: print(*x, sep="\n")
dij = [(1, 0), (0, 1), (-1, 0), (0, -1)]

def main():
    def dig(x):
        s=str(x)
        return sum(int(c) for c in s)
    n,a,b=MI()
    ans=0
    for x in range(1,n+1):
        if a<=dig(x)<=b:ans+=x
    print(ans)

main()

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

for num in range(1, N+1):
    str_num = str(num)
    tmp = 0
    for char in str_num:
        char = int(char)
        tmp += char
    if tmp >= A and tmp <= B:
        ans += num

print(ans)

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


if __name__ == '__main__':
    main()

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

ans = 0
for i in range(1, N + 1):
  s = list(str(i))
  t = 0
  for j in s:
    t += int(j)
  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):
    count = 0
    for x in str(i):
        count += int(x)
    if count >= A and count <= B:
        ans += i
print(ans)

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

sum  = 0

for i in range (1, N+1):
	nyoki = 0
	stri = str(i)
	for j in range (1, len(stri)+1):
		nyoki = nyoki+int(stri[j-1])
	if nyoki >= A and nyoki <= B:
		sum = sum+i

print(sum)

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

ans = 0
for i in range(N+1):
    s = str(i)
    jdg = 0
    for k in range(len(s)):
        jdg += int(s[k])
    if A <= jdg and jdg <=B:
        ans += i
print(ans)

Solution (Python):

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

ans = 0
for i in range(1, n + 1):
    tmp = str(i)
    su = 0
    for j in tmp:
        su += int(j)
    
    if a <= su <= b:
        ans += i
print(ans)

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

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

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

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

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

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

ans = 0
for i in range(1,n+1):
    s = 0
    q = i
    for j in range(5):
        r = q % 10
        s += r
        q //= 10
    
    if a <= s and s <= b:
        ans += i
        
print(ans)

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

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

Solution (Python):
N,a,b = map(int,input().split())
sums = 0
for i in range(1,N+1):
    moji = list(str(i))
    moji = [int(j) for j in moji]
    ans = sum(list(moji))
    
    if a <= ans and ans <= b:
        sums += i
print(sums)

Solution (Python):

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

ans = 0
for i in range(1, n + 1):
    tmp = str(i)
    su = 0
    for j in tmp:
        su += int(j)
    
    if a <= su <= b:
        ans += i
print(ans)

Solution (Python):
N,A,B = map(int,input().split())
ans = 0
for i in range(1,N+1):
  K = str(i)
  if len(K) == 1:
    if A<=int(K[0])<=B:
      ans += i
  elif len(K) == 2:
    if A<=int(K[0])+int(K[1])<=B:
      ans += i
  elif len(K) == 3:
    if A<=int(K[0])+int(K[1])+int(K[2])<=B:
      ans += i
  elif len(K) == 4:
    if A<=int(K[0])+int(K[1])+int(K[2])+int(K[3])<=B:
      ans += i
  elif len(K) == 5:
    if A<=int(K[0])+int(K[1])+int(K[2])+int(K[3])+int(K[4])<=B:
      ans += i
print(ans)

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

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

Solution (Python):

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

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

ans = 0
for i in range(1, N+1):
  a = list(str(i))
  c = 0
  for j in range(len(a)):
    c += int(a[j])
  if A <= c <= B:
    ans += i
print(ans)

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

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

Solution (Python):
N, A, B = map(int, input().split())
ans = 0
for i in range(1, N + 1):
    str_i = str(i)
    digit_sum = 0
    for j in range(len(str_i)):
        digit_sum += int(str_i[j])
    if A <= digit_sum and digit_sum <= B:
        ans += i
print(ans)