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



Sample input:
20 2 5


Sample output:
84

Submission status: Runtime Error

Solution code:
N,A,B=map(int,input().split())
for i in range(1,N+1):
    ans=i%10+i/10%10+i/100%10+i/1000%10+i/10000%10
    if A<=ans and ans<=B:
        total.append(ans)
print(sum(total))

Submission status: Runtime Error

Solution code:
arr = list(map(int, input().split()))
au = sum(i for in range(arr[0]) if arr[1] <= sum(map(int, str(i))) <= arr[2])
print(au)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
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 += 1
print(ans)

Submission status: Runtime Error

Solution code:
Lis = list(map(int,input().split()))
ans = 0
for k in range(Lis[0]+1):
    if k%10 + (k//10)%10 + (k//100)%10 + (k//1000)%10 <= Lis[2] and k%10 + (k//10)%10 + (k//100)%10 + (k//1000)%10 >= Lis[1]:
        ans += k
if N == 10000:
           print(ans+10000)
else:
           print(ans)

Submission status: Runtime Error

Solution code:
N,A,B = map(int, input().split())
total = 0
for num in range(1,N):
    cnt = 0
    num_str = str(num)
    for i in num_str:
        cnt += int(i)
        if A <= cnt <= B:
            total += num_str

print(total)

Submission status: Runtime Error

Solution code:
Last login: Mon Jun 24 15:45:40 on ttys001

okazaki@shinji-2(16:27:24) ~
% ls                                                                       [~]
#.zshrc#        Downloads       Pictures        Untitled2.ipynb
Applications    Library         Public          anaconda3
Desktop         Movies          Untitled.ipynb  play
Documents       Music           Untitled1.ipynb

okazaki@shinji-2(16:27:27) ~
% mkdir prokon                                                             [~]

okazaki@shinji-2(16:28:18) ~
% cd prokon                                                                [~]

okazaki@shinji-2(16:28:23) ~/prokon
% ls                                                                  [prokon]

okazaki@shinji-2(16:28:24) ~/prokon
% mkdir 20190624                                                      [prokon]

okazaki@shinji-2(16:28:36) ~/prokon
% ls                                                                  [prokon]
20190624

okazaki@shinji-2(16:30:19) ~/prokon
% cd ..                                                               [prokon]

okazaki@shinji-2(16:30:21) ~
% ls                                                                       [~]
#.zshrc#        Downloads       Pictures        Untitled2.ipynb
Applications    Library         Public          anaconda3
Desktop         Movies          Untitled.ipynb  play
Documents       Music           Untitled1.ipynb prokon

okazaki@shinji-2(16:30:29) ~
% cd prokon                                                                [~]

okazaki@shinji-2(16:30:33) ~/prokon
% ls                                                                  [prokon]
20190624

okazaki@shinji-2(16:30:35) ~/prokon
% rmdir 20190624                                                      [prokon]

okazaki@shinji-2(16:30:42) ~/prokon
% ls                                                                  [prokon]

okazaki@shinji-2(16:30:44) ~/prokon
% ls                                                                  [prokon]

okazaki@shinji-2(16:31:36) ~/prokon
% mkdir 083                                                           [prokon]

okazaki@shinji-2(16:31:41) ~/prokon
% mkdir 088                                                           [prokon]

okazaki@shinji-2(16:31:48) ~/prokon
% mkdir 085                                                           [prokon]

okazaki@shinji-2(16:31:56) ~/prokon
% ls                                                                  [prokon]
083 085 088

okazaki@shinji-2(16:31:58) ~/prokon
% cd 083                                                              [prokon]

okazaki@shinji-2(16:32:03) ~/prokon/083
% emacs b.py                                                             [083]

okazaki@shinji-2(16:36:04) ~/prokon/083
% b.py                                                                   [083]
zsh: command not found: b.py

okazaki@shinji-2(16:36:10) ~/prokon/083
% python b.py                                                            [083]
Traceback (most recent call last):
  File "b.py", line 1, in <module>
    N,A,B = map(char,input().split())
NameError: name 'char' is not defined

okazaki@shinji-2(16:36:19) ~/prokon/083
% emacs b.py                                                             [083]

okazaki@shinji-2(16:38:03) ~/prokon/083
% python b.py                                                            [083]
\  File "b.py", line 5
    for i in 10x:
               ^
SyntaxError: invalid syntax

okazaki@shinji-2(16:38:04) ~/prokon/083
% emacs b.py                                                             [083]

okazaki@shinji-2(16:38:17) ~/prokon/083
% python b.py                                                            [083]
10
3 5
Traceback (most recent call last):
  File "b.py", line 5, in <module>
    for i in 10:
TypeError: 'int' object is not iterable

okazaki@shinji-2(16:38:25) ~/prokon/083
% emacs b.py                                                             [083]

okazaki@shinji-2(16:39:02) ~/prokon/083
% python b.py                                                            [083]
10
2
Traceback (most recent call last):
  File "b.py", line 2, in <module>
    A,B = map(int,input().split())
ValueError: not enough values to unpack (expected 2, got 1)

okazaki@shinji-2(16:39:06) ~/prokon/083
% python b.py                                                            [083]
10   
3 4
10
3
4

okazaki@shinji-2(16:39:17) ~/prokon/083
% emacs b.py                                                             [083]

okazaki@shinji-2(16:40:28) ~/prokon/083
% python b.py                                                            [083]
10
3 4
1

okazaki@shinji-2(16:40:35) ~/prokon/083
% python b.py                                                            [083]
28 
3 5
10

okazaki@shinji-2(16:40:49) ~/prokon/083
% emacs b.py                                                             [083]

okazaki@shinji-2(16:44:11) ~/prokon/083
% python b.py                                                            [083]
15
3 4
15

okazaki@shinji-2(16:44:17) ~/prokon/083
% emacs b.py                                                             [083]

okazaki@shinji-2(16:47:38) ~/prokon/083
% emacs b.py                                                             [083]

okazaki@shinji-2(16:47:44) ~/prokon/083
% python b.py                                                            [083]
20
2 5
28

okazaki@shinji-2(16:47:52) ~/prokon/083
% emacs b.py                                                             [083]

okazaki@shinji-2(16:50:33) ~/prokon/083
% python b.py                                                            [083]
20
2 5
40

okazaki@shinji-2(16:50:44) ~/prokon/083
% python b.py                                                            [083]
20 2 5
^Z
zsh: suspended  python b.py

okazaki@shinji-2(16:50:57) ~/prokon/083
% emacs b.py                                                             [083]

okazaki@shinji-2(16:52:11) ~/prokon/083
% python b.py                                                            [083]
20 2 5
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
40

okazaki@shinji-2(16:52:18) ~/prokon/083
% emacs b.py                                                             [083]

okazaki@shinji-2(16:52:39) ~/prokon/083
% python b.py                                                            [083]
20 2 5 
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
190

okazaki@shinji-2(16:52:45) ~/prokon/083
% emacs b.py                                                             [083]

okazaki@shinji-2(16:53:17) ~/prokon/083
% python b.py                                                            [083]
20 2 5
Traceback (most recent call last):
  File "b.py", line 15, in <module>
    keta = sum(list(map(int,str(n))))
NameError: name 'n' is not defined

okazaki@shinji-2(16:53:22) ~/prokon/083
% emacs b.py                                                             [083]

okazaki@shinji-2(16:53:40) ~/prokon/083
% python b.py                                                            [083]
20 2 5
0
1
2
3
4
5
6
7
8
9
1
2
3
4
5
6
7
8
9
10
64

okazaki@shinji-2(16:53:43) ~/prokon/083
% emacs b.py                                                             [083]

okazaki@shinji-2(16:54:34) ~/prokon/083
% python b.py                                                            [083]
20 2 5
1
2
3
4
5
6
7
8
9
1
2
3
4
5
6
7
8
9
10
2
84

okazaki@shinji-2(16:54:38) ~/prokon/083
% emacs b.py                                                             [083]

okazaki@shinji-2(16:55:45) ~/prokon/083
% python b.py                                                            [083]
20 2 5
2
3
4
5
2
3
4
5
2
84

okazaki@shinji-2(16:55:51) ~/prokon/083
% emacs b.py                                                             [083]

okazaki@shinji-2(16:56:17) ~/prokon/083
% emacs b.py                                                             [083]

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

count = 0

'''                                                                            
def keta_sum(n):                                                               
    sum = 0                                                                    
    while n>0:                                                                 
        sum += n%10 #対象の桁を加算                                            
        n = n//10 # 次の桁をみる                                               
    return(sum)                                                                
'''

for i in range(N):
    keta = sum(list(map(int,str(i+1))))

    if keta >= A and keta<= B:
      #  print(keta)                                                           
        count += (i+1)

print(count)

Submission status: Runtime Error

Solution code:
N,A,B = map(int, input().split())
l = []

for i in range(N):
    if i >= 10:
        keta_one = i //10
        keta_ten = i % 10
        sum = keta_one + keta_ten
    else:
        sum = i
    if 2 <= i <=5:
        l.append(i)
print(l)
print(sum(l))

Submission status: Runtime Error

Solution code:
N = int(input())
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)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
N, A, B = map(input, [input() for i in range(3)])

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

Submission status: Runtime Error

Solution code:
A=345
B=list(A)
print(B)
print(B[1])

Submission status: Runtime Error

Solution code:
s = input().split()
N = int(s[0])
A = int(s[1])
B = int(s[2])
k = 0
for i in range(1,N+1):
  S = 0
  while l >= 1:
    l = i
    p = l%10
    l = l//10
    S = S + p
  if A <= S <= B:
    k = k + i
print(k)

Submission status: Runtime Error

Solution code:
n, a, b = [int(x) for x in input().split()]
count = 0
for i in range(a, n+1):
	  if sum([int(x) for x in list(str(i))]) > b:
      	continue
      count += 1
print(count)

Submission status: Runtime Error

Solution code:
n, a, b = [int(x) for x in input().split()]
count = 0
for i in range(a, n+1):
	  if sum(list(str(i))) > b:
      	continue
      i += 1
print(i)

Submission status: Runtime Error

Solution code:
n, a, b = map(int, input().split())
for i in range(n+1):
    o = i // 10000
    p = (i % 10000) // 1000
    q = (i % 1000) // 100
    r = (i % 100) // 10
    s = i % 10
    if a <= o + p + q + r + s <= b:
        su += i
print(su)

Submission status: Runtime Error

Solution code:
n, a, b = map(int, input().split())
for i in range(n+1):
    if i >= 10:
        x = i // 10
        y = i - x * 10
        if a <= x + y <= b:
            s += i
    if a <= i <= b:
        s += i
print(s)

Submission status: Runtime Error

Solution code:
n,a,b=map(int,input().split())
ans=0
def digitsum(n):
  l=len(str(n))
  re=0
  for i in range(l):
    re+=int(str(n[i]))
  return re
for i in range(n):
  if a<=digitsum(i)<=b:
    ans+=i
print(ans)

Submission status: Runtime Error

Solution code:
n,a,b=map(int,input().split())
ans=0
def digitsum(n):
  l=len(str(n))
  re=0
  for i in range(l):
    re+=int(str(n[i]))
  return re
for i in range(n):
  if a<=digitsum(i)<=b:
    ans+=i
print(i)

Submission status: Runtime Error

Solution code:
l = list(map(int,input().split()))
a = 0
b = 1
c = 1
while c <= l[0]:
    if a + b >= l[1] and a + b <= l[2]:
        sum += c
    if b == 9:
        b = 0
        a += 1
    else:
        b += 1
    c = 10 * a + b
print(sum)

Submission status: Runtime Error

Solution code:
l = list(map(int,input().split()))
a = 0
b = 1
c = 1
while c <= l[1]:
    if a + b >= l[2] and a + b <= l[3]:
        sum += c
    if b == 9:
        b = 0
        a += 1
    else:
        b += 1
    c = 10 * a + b
print(sum)

Submission status: Runtime Error

Solution code:
l = list(map(int,input().split()))
a = 0
b = 0
c = 0
while c <= l[1]:
    if a + b >= l[2] and a + b <= l[3]:
        sum += c
    if b == 9:
        b = 0
        a += 1
    else:
        b += 1
    c = 10 * a + b
print(sum)

Submission status: Runtime Error

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

def add(n,a,b):
    ls = list(str(n))
    pl = sum([int(i) for i in ls])
    if a<= pl<= b:
        return 1
    else:
        pass

flg = 0
for i in range(n+1):
    flg += add(i,a,b)

print(flg)

Submission status: Runtime Error

Solution code:
N,A,B = map(int, input().split())
ten_keta = N[:1]
one_keta = N[1:]
ans = 0

for i in range(N+1):
    if int(ten_keta) + int(one_keta) >= A and ten_keta + one_keta <= B:
        ans += i

print(ans)

Submission status: Runtime Error

Solution code:
N,A,B = map(int, input().split())
ten_keta = int(N[0])
one_keta = int(N[1])
ans = 0

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

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N,A,B=map(int,input().split())
#n1=N//10
#n2=N%10
#n=n1+n2
ans=0
for i in range(N+1):
    if i>=100:
        i1=i//100
       # i2=(i-100)//10
        i3=i%10
        j=i1+i3
        if j>=A and j<=B:
            ans+=j
    else:
        i1=i//10
        i2=i%10
        j=i1+i2
        if j>=A and j<=B:
            ans+=0
print(n)

Submission status: Runtime Error

Solution code:
N,A,B=map(int,input().split())
#n1=N//10
#n2=N%10
#n=n1+n2
n=0
for i in range(N+1):
    if N >=100:
        i1=i//100
        i2=(i-100)//10
        i3=i%10
        j=i1+i2+i3
         if j>=A and j<=B:
        n+=1
    else:
        i1=i//10
        i2=i%10
        j=i1+i2
        if j>=A and j<=B:
            n+=1

Submission status: Runtime Error

Solution code:
N,A,B=map(int,input().split())
#n1=N//10
#n2=N%10
#n=n1+n2
n=0
for i in range(N+1):
    if N >=100:
        i1=i//100
        i2=(i-100)//10
        i3=i%10
        j=i1+i2+i3
         if j>=A and j<=B:
        n+=0
    else:
        i1=i//10
        i2=i%10
        j=i1+i2
        if j>=A and j<=B:
            n+=0

Submission status: Runtime Error

Solution code:
N,A,B=map(int,input().split())
#n1=N//10
#n2=N%10
#n=n1+n2
n=0
for i in range(N+1):
    if N >=100:
        i1=i//100
        i2=(i-100)//10
        i3=i//10
        j=i1+i2+i3
         if j>=A and j<=B:
        n+=0
    else:
        i1=i//10
        i2=i%10
        j=i1+i2
        if j>=A and j<=B:
            n+=0

Submission status: Runtime Error

Solution code:
N,A,B=map(int,input().split())
#n1=N//10
#n2=N%10
#n=n1+n2
n=0
for i in range(N+1)
i1=i//10
i2=i%10
j=i1+i2
if j>=A and j<=B:
    n+=0

Submission status: Runtime Error

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

def sum(k):
  s = 0
  for j in range(len(s)):
    s+=int(k[j])
  return s

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

Submission status: Runtime Error

Solution code:
#天秤
  
a,b,c,d=map(int,input().split())

l=a+b
r=c+d

if l==r:
	print("Balanced")
else:
	if l>r:
		print("Left")
	else:
		print("Right")

Submission status: Runtime Error

Solution code:
#1以上N以下の整数のうち、10進法で各桁の和がA以上B以下であるものについて総和
  
n=int(input())
a=int(input())
b=int(input())
 
def s(x):
        return x//10000 + x%10000//1000 + x%1000//100 + x%100//10 + x%10
 
sum=0
 
for i in range(n+1):
        if a<=int(s(i))<=b:
                sum+=i
 
print(sum)

Submission status: Runtime Error

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

total = 0

for n in range(1,N+1)
    sum = 0
    q = n
    while q != 0:
        sum += (q%10)
        q = q//10
    if (A<=sum) and (sum<=B):
        total += n

print(total)

Submission status: Runtime Error

Solution code:
n, a, b = map(int, input().split())
res = 0

for i in range(1:n+1):
  sum = 0
  j=0
  while True:
    num = i/(10**j)%10
    if num != 0:
      sum += num
      j+=1
    else:
      break
  if a<=sum && sum<=b:
    res += sum;

print(res)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

def findSumOfDigits(n):
    sum = 0
    while n > 0.1:
        sum = sum + (n % 10)
        #print(n % 10)
        n = n - (n % 10)
        n = n / 10
    return sum

# 整数の入力
n = input()
n = int(n)

a = input()
a = int(a)

b = input()
b = int(b)

ans = 0

for i in range(1,n+1):
    #print(i)
    test = findSumOfDigits(i)
    if a <= test:
        if b >= test:
            ans = ans + i

print(int(ans))

Submission status: Runtime Error

Solution code:
a, b, c = map(int, input().split())
ans = 0
for i range(1, a+1):
    N = [int(x) for x in str(i)]
    sum = sum(N)
    if b <= sum and sum <= c:
        ans += sum

print(ans)

Submission status: Runtime Error

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

N = []
ans = 0

for i range(1, a+1):
    N = [int(x) for x in str(i)]
    sum = sum(N)
    if b <= sum and sum <= c:
        ans += sum

print(ans)

Submission status: Runtime Error

Solution code:
#include<stdio.h>

int digit_sum(int num);

int main() {
	int n, a, b, cnt, i, temp;

	cnt = 0;
	scanf("%d%d%d", &n, &a, &b);
	for (i = 1; i <= n; i++) {
		temp = digit_sum(i);
		if (a <= temp && temp <= b) cnt += i;
	}
	printf("%d", cnt);
	return 0;
}

int digit_sum(int num) {
	if (num > 9) return num % 10 + digit_sum(num / 10);
	else return num;
}

Submission status: Runtime Error

Solution code:
# ABC083B - Some Sums
import sys

n, a, b = list(map(int, stdin.readline().split()))
answer = 0
for i in range(1, n + 1):
    total = 0
    while i > 9:
        total += i % 10
        i //= 10
    if a <= i and i <= b:
        answer += total

print(answer)

Submission status: Runtime Error

Solution code:
N = int(input())
A = int(input())
B = int(input())

ans = 0

for x in range(N+1):
    sum = 0
    xx = x
    while xx != 0:
        sum += xx % 10
        xx = xx / 10

    if A <= sum and B >= sum:
        ans += x

print(ans)

Submission status: Runtime Error

Solution code:
N = int(raw_input())
A = int(raw_input())
B = int(raw_input())

ans = 0

for x in range(N+1):
    sum = 0
    xx = x
    while xx != 0:
        sum += xx % 10
        xx = xx / 10

    if A <= sum and B >= sum:
        ans += x

print(ans)

Submission status: Runtime Error

Solution code:
N, A, B = input().split()
A = int(A)
B = int(B)
k_sum = 0
ans = 0
for j in range(1, int(N)+1):
  j = str(j)
  for i in range(len(j)):
  	k_sum += int(j[i])
  if k_sum >= A and k_sum <= B:
    ans += int[j]

print(j)

Submission status: Runtime Error

Solution code:
listNAB = input().split()
listNABint = [int(s) for s in A]

def Placesum(x):
    y = str(x)
    counter = 0
    for i in range(len(y)):
        counter += int(y[i])
    return counter

sumcounter = 0
for i in range(N):
    if A <= Placesum(i+1) & Placesum(i+1) <= B:
        sumcounter += i+1
        print(sumcounter)
print(sumcounter)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
# Input
list = []
for _ in range(3):
    list += [int(input())]

total = 0
for ii in range(1, list[0] + 1):
    sum = 0
    tmp = ii
    while tmp > 0:
        sum += tmp % 10
        tmp = tmp // 10

    if sum >= list[1] and sum <= list[2]:
        total += ii
print(total)

Submission status: Runtime Error

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

for num in range(1, n+1):
  bits = list()
  while num > 0:
    tmp = num % 10
    bits.append(tmp)
    num -= tmp
    num /= 10
  if a <= bits.sum() <= b:
    ans += 1

print(ans)

Submission status: Runtime Error

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

for num in range(1, n+1):
  bits = list()
  while num > 0:
    tmp = num % 10
    bits.append(tmp)
    num //= 10
  if a <= bits.sum() <= b:
    ans += 1

print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
A = int(input())
B = int(input())

sum = 0
for a in range(N+1):
  
  a = str(a)
  a_list = list(a)
  a_list_i = [int(a) for a in a_list]

  a_list_i_sum = 0
  for b in a_list_i:
    a_list_i_sum = a_list_i_sum + b
  if a_list_i_sum >=A and a_list_i_sum <= B:
    sum = sum + int(a)

print(sum)

Submission status: Runtime Error

Solution code:
n,a,b=map(int,input())
ans=0
for i in range(n):
  t=0
  i1=i
  for j in range(i):
    t+=i1%10
    i1//10
    if i1==0:
      break
  if a<=t<=b:
    ans+=i
print(ans)

Submission status: Runtime Error

Solution code:
def wa(n,a,b):
  hoge=0
  for i in range(1,n+1):
    s=str(i)
    for ii in s:
      hoge+=int(ii)
    if a<=hoge<=b:
      ans+=i
  return ans
n,a,b=map(int,input().split())
print(wa(n,a,b))

Submission status: Runtime Error

Solution code:
def wa(n,a,b):
  for i in range(1,n+1):
    s=str(i)
    for ii in s:
      ss+=int(ii)
    if a<=ss<=b:
      ans+=i
  return ans
n,a,b=map(int,input().split())
print(wa(n,a,b))

Submission status: Runtime Error

Solution code:
def wa(n,a,b):
  for i in range(1,n+1):
    s=str(i)
    for ii in s:
      ss+=int(ii)
    if a=<ss=<b:
      ans+=i
  return ans
n,a,b=map(int,input().split())
print(wa(n,a,b))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
A = int(input())
B = int(input())

outValue = 0
for n in range(N+1):
    #inputList = [int(c) for c in str(n)]
    #if A <= sum(inputList) <= B:
    #    outValue += n

print(outValue)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
A = int(input())
B = int(input())

outValue = 0
for n in range(N+1):
    inputList = [int(c) for c in str(n)]
    #if A <= sum(inputList) <= B:
    #    outValue += n

print(outValue)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
A = int(input())
B = int(input())

outValue = 0
for n in range(N+1):
    inputList = [int(c) for c in str(n)]
    if A <= sum(inputList) and sum(inputList) <= B:
        outValue += n

print(outValue)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
A = int(input())
B = int(input())

outValue = 0
for n in range(N+1):
    inputList = []
    for c in str(n):
        inputList.append(int(c))

    if A <= sum(inputList) <= B:
        outValue += n

print(outValue)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
A = int(input())
B = int(input())

outValue = 0
for n in range(N+1):
    inputList = [int(c) for c in str(n)]
    if A <= sum(inputList) <= B:
        outValue += n

print(outValue)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
A = int(input())
B = int(input())

outValue = 0
for n in range(N+1):
    inputList = [int(c) for c in str(n)]
    if A <= sum(inputList) <= B:
        outValue += n

print(outValue)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
A = int(input())
B = int(input())

outValue = 0
for n in range(N+1):
    inputList = [int(c) for c in str(n)]
    if A <= sum(inputList) <= B:
        outValue += n

print(outValue)

Submission status: Runtime Error

Solution code:
#coding:utf-8

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
100 4 16

Submission status: Runtime Error

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

Submission status: Runtime Error

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

counter = [0 for _ in range(N)]
ans = 0

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

print(ans)

Submission status: Runtime Error

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

counter = [0 for _ in range(N)]
ans = 0

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

print(ans)

Submission status: Runtime Error

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

counter = [0 for _ in range(N)]
ans = 0

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

print(ans)

Submission status: Runtime Error

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

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

print(ans)

Submission status: Runtime Error

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

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

print(ans)

Submission status: Runtime Error

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

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

print(ans)

Submission status: Runtime Error

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

counter = [0 for _ in range(N)]
ans = 0
for i in range(N+1):
    st = str(i)
    for j in range(len(st)):
        counter[i] = counter[i] + st[j]
    if A<=counter[i]<=B :
        ans = ans + i

print(ans)

Submission status: Runtime Error

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

counter = [0 for _ in range(N)]
ans = 0
for i in range(N+1):
    st = str(i)
    for j in range(len(st)+1):
        counter[i] = counter[i] + st[j]
    if counter[i]>=A and counter[i]<=B :
        ans = ans + i

print(ans)

Submission status: Runtime Error

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

counter = [0 for _ in range(N)]
ans = 0
for i in range(N+1):
    st = str(i)
    for j in range(len(st)):
        counter[i] = counter[i] + st[j]
    if counter[i]>=A and counter[i]<=B :
        ans = ans + i

print(ans)

Submission status: Runtime Error

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

counter = [0 for _ in range(N)]
ans = 0
for i in range(N):
    st = str(i)
    for j in range(len(st)):
        counter[i] = counter[i] + st[j]
    if counter[i]>=A and counter[i]<=B :
        ans = ans + i

print(ans)

Submission status: Runtime Error

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

counter = [0 for _ in range(N)]
ans = 0
for i in range(N):
    string = str(i)
    for j in range(len(string)):
        counter[i] = counter[i] + string[j]
    if counter[i]>=A and counter[i]<=B:
        ans = ans + i

print(ans)

Submission status: Runtime Error

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

counter = [0 for _ in range(N)]
ans = 0
for i in range(N):
    string = str(i)
    for j in range(len(str)):
        counter[i] = counter[i] + string[j]
    if counter[i]>=A and counter[i]<=B:
        ans = ans + i
print(ans)

Submission status: Runtime Error

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

counter = [0 for _ in range(N)]
ans = 0
for i in range(N):
    string = str(i)
    for j in range(len(str)):
        counter[i] = counter[i] + string[j]
    if(counter[i]>=A and counter[i]<=B):
        ans = ans + i
print(ans)

Submission status: Runtime Error

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

counter = [0 for _ in range(N)]
ans = 0
for i in range(N):
    string = str(i)
    for j in range(len(str)):
        counter[i] += string[j]
    if(counter[i]>=A and counter[i]<=B):
        ans += i
print(ans)

Submission status: Runtime Error

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

counter = [0 for _ in range(N)]
ans = 0

for i in range(N):
    string = str(i)
    for j in range(len(string)):
        counter[i] += string[j]

for i in range(N):
  if(counter[i]<=B and counter[i]>=A):
    ans += i

print(ans)

Submission status: Runtime Error

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

counter = [0 for _ in range(N)]
ans = 0

for i in range(N):
    string = str(i)
    for j in range(len(string)):
        counter[i] += string[j]

for i in range(N):
    if(counter[i]<=B and counter[i]>=A):
        ans += i

print(ans)