ZhenlongDai/ACPR huggingface dataset:
Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,A,B = map(int,input().split())
ans = 0
for i in range(N):
  s = str(i)
  if 1<=i<=9:
    if A<=i<=B:
      ans += i
  elif 10<=i<=99:
    if A<=((1+int(s[1])))<=B:
      ans += i
  elif 100<=i<=999:
    if A<=((1+int(s[1])+int(s[2])))<=B:
      ans += i
  elif 1000<=i<=9999:
    if A<=((1+int(s[1])+int(s[2])+int(s[3])))<=B:
      ans += i
  else:
    if A==B and A == 1 and B == 1:
      ans += i
print(ans)


Failing test case input:
101 2 19

Expected output:
5040


Actual output:
4499


Fixed submission (verdict: Accepted):
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)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b = (int(i) for i in input().split())
s=0
h=0
for i in range(1,n):
  j=0
  s=0
  while j<4:
    s += i%10
    i = i/10
    if i==0:
      break
  if s>=a and s<=b:
    h += s
    

print(h)

Failing test case input:
10 2 4

Expected output:
9


Actual output:
5.555555555555555


Fixed submission (verdict: Accepted):
n, a, b = (int(i) for i in input().split())
s=0
h=0
f=0
for i in range(1,n+1):
  j=0
  s=0
  f=i
  while j<5:
    s += i%10
    i = int(i/10)
    j=j+1
    
     
  if s>=a and s<=b:
    h = h + f
    
print(h)

Problem: p03478
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,a,b = map(int,input().split())
cnt = []
for i in range(1,n+1):
	s = list(map(int,str(i)))
	print(s)
	if  a<=sum(s)<=b:
		cnt.append(i)
print(sum(cnt))

Failing test case input:
101 1 010

Expected output:
2511


Actual output:
[1]
[2]
[3]
[4]
[5]
[6]
[7]
[8]
[9]
[1, 0]
[1, 1]
[1, 2]
[1, 3]
[1, 4]
[1, 5]
[1, 6]
[1, 7]
[1, 8]
[1, 9]
[2, 0]
[2, 1]
[2, 2]
[2, 3]
[2, 4]
[2, 5]
[2, 6]
[2, 7]
[2, 8]
[2, 9]
[3, 0]
[3, 1]
[3, 2]
[3, 3]
[3, 4]
[3, 5]
[3, 6]
[3, 7]
[3, 8]
[3, 9]
[4, 0]
[4, 1]
[4, 2]
[4, 3]
[4, 4]
[4, 5]
[4, 6]
[4, 7]
[4, 8]
[4, 9]
[5, 0]
[5, 1]
[5, 2]
[5, 3]
[5, 4]
[5, 5]
[5, 6]
[5, 7]
[5, 8]
[5, 9]
[6, 0]
[6, 1]
[6, 2]
[6, 3]
[6, 4]
[6, 5]
[6, 6]
[6, 7]
[6, 8]
[6, 9]
[7, 0]
[7, 1]
[7, 2]
[7, 3]
[7, 4]
[7, 5]
[7, 6]
[7, 7]
[7, 8]
[7, 9]
[8, 0]
[8, 1]
[8, 2]
[8, 3]
[8, 4]
[8, 5]
[8, 6]
[8, 7]
[8, 8]
[8, 9]
[9, 0]
[9, 1]
[9, 2]
[9, 3]
[9, 4]
[9, 5]
[9, 6]
[9, 7]
[9, 8]
[9, 9]
[1, 0, 0]
[1, 0, 1]
2511


Fixed submission (verdict: Accepted):
n,a,b = map(int,input().split())
cnt = []
for i in range(1,n+1):
	s = list(map(int,str(i)))
	if  a<=sum(s)<=b:
		cnt.append(i)
print(sum(cnt))
Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b = map(lambda x:int(x),input().strip().split())
res = []

for i in range(1,n+1):
    tmp = sum(list(map(lambda x:int(x),list(str(i)))))
    if tmp>=a and tmp<=b:
        print("ok",tmp)
        res.append(i)
print(sum(res))



Failing test case input:
4 -2 6

Expected output:
10


Actual output:
ok 1
ok 2
ok 3
ok 4
10


Fixed submission (verdict: Accepted):
n,a,b = map(lambda x:int(x),input().strip().split())
res = []

for i in range(1,n+1):
    tmp = sum(list(map(lambda x:int(x),list(str(i)))))
    if tmp>=a and tmp<=b:
        res.append(i)
print(sum(res))

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

def main():
    num_n, num_a, num_b = list(map(int, input().split()))
    count_list = []
    for i in range(1, num_n + 1):
        print("num", i)
        digit_list = list(str(i))
        digit_list_int = [int(j) for j in digit_list]
        num_sum = sum(digit_list_int)
        if num_a <= num_sum and num_sum <= num_b: count_list.append(i)
    
    print(sum(count_list))

    


if __name__ == '__main__':
    main()


Failing test case input:
6 2 5

Expected output:
14


Actual output:
num 1
num 2
num 3
num 4
num 5
num 6
14


Fixed submission (verdict: Accepted):
import math

def main():
    num_n, num_a, num_b = list(map(int, input().split()))
    count_list = []
    for i in range(1, num_n + 1):
        
        digit_list = list(str(i))
        digit_list_int = [int(j) for j in digit_list]
        num_sum = sum(digit_list_int)
        if num_a <= num_sum and num_sum <= num_b: count_list.append(i)
    
    print(sum(count_list))

    


if __name__ == '__main__':
    main()

Problem: p03478
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def sum_of_digits(n):
  s = 0
  while n > 0:
    s += n % 10
    n = int(n / 10)
  return s

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

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


Failing test case input:
100 1 010

Expected output:
2410


Actual output:
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 1
11 2
12 3
13 4
14 5
15 6
16 7
17 8
18 9
19 10
20 2
21 3
22 4
23 5
24 6
25 7
26 8
27 9
28 10
29 11
30 3
31 4
32 5
33 6
34 7
35 8
36 9
37 10
38 11
39 12
40 4
41 5
42 6
43 7
44 8
45 9
46 10
47 11
48 12
49 13
50 5
51 6
52 7
53 8
54 9
55 10
56 11
57 12
58 13
59 14
60 6
61 7
62 8
63 9
64 10
65 11
66 12
67 13
68 14
69 15
70 7
71 8
72 9
73 10
74 11
75 12
76 13
77 14
78 15
79 16
80 8
81 9
82 10
83 11
84 12
85 13
86 14
87 15
88 16
89 17
90 9
91 10
92 11
93 12
94 13
95 14
96 15
97 16
98 17
99 18
100 1
2410


Fixed submission (verdict: Accepted):
def sum_of_digits(n):
  s = 0
  while n > 0:
    s += n % 10
    n = int(n / 10)
  return s

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

for i in range(1, n + 1):
  if a <= sum_of_digits(i) <= b:
    res += i
    
print(res)
Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


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

cnt = 0
for i in range(1, n + 1):
  str_i = str(i)
  sum = 0
  for char in str_i:
    sum += int(char)
  if sum >= a and sum <= b:
    cnt += 1
    
print(cnt)

Failing test case input:
3 0 4

Expected output:
6


Actual output:
3


Fixed submission (verdict: Accepted):


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

total = 0
for i in range(1, n + 1):
  str_i = str(i)
  sum = 0
  for char in str_i:
    sum += int(char)
  if sum >= a and sum <= b:
    total += i
    
print(total)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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

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

Failing test case input:
101 3 12

Expected output:
3212


Actual output:
584


Fixed submission (verdict: Accepted):

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

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

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b = (int(i) for i in input().split())
s=0
h=0
f=0
for i in range(1,n+1):
  j=0
  s=0
  f=i
  while j<5:
    s += i%10
    i = i/10
    j=j+1
    if i==0:
      break
  if s>=a and s<=b:
    h += f
    

print(h)

Failing test case input:
101 5 12

Expected output:
3036


Actual output:
2090


Fixed submission (verdict: Accepted):
n, a, b = (int(i) for i in input().split())
s=0
h=0
f=0
for i in range(1,n+1):
  j=0
  s=0
  f=i
  while j<5:
    s += i%10
    i = int(i/10)
    j=j+1
    
     
  if s>=a and s<=b:
    h = h + f
    
print(h)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
lis=list(map(int,input().split()))
N ,A, B= lis[0],lis[1],lis[2]

ans = 0
for i in range(1,N+1):
    i1 =  i%10
    i10 = (i%100 -i1)/10
    i100 = (i%1000 -i1 - 10*i10)/100
    i1000 = (i%10000 -i1 - 10*i10-100*i100)/100
    i10000 = (i -i1 -10*i10 -100*i100 - 1000*i1000)/10000
    if A<=i1+i10+i100+i1000+i10000<=B:
        ans +=1
print(ans)

Failing test case input:
101 6 111

Expected output:
4565


Actual output:
79


Fixed submission (verdict: Accepted):
lis=list(map(int,input().split()))
N ,A, B= lis[0],lis[1],lis[2]

ans = 0
for i in range(1,N+1):
    i1 =  i%10
    i10 = (i%100 -i1)/10
    i100 = (i%1000 -i1 - 10*i10)/100
    i1000 = (i%10000 -i1 - 10*i10-100*i100)/1000
    i10000 = (i -i1 -10*i10 -100*i100 - 1000*i1000)/10000
    if A<=i1+i10+i100+i1000+i10000<=B:
        ans += i
print(ans)
Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b = map(int, input().split())
ans = 0
for i in range(n+1):
  str_i = str(i)
  sum_i = 0
  for j in range(len(str_i)):
    sum_i += int(str_i[j])
  print(i)
  print(sum_i)
  if (sum_i >= a) & (sum_i <= b):
    ans+=i
print(ans)

Failing test case input:
110 6 110

Expected output:
5100


Actual output:
0
0
1
1
2
2
3
3
4
4
5
5
6
6
7
7
8
8
9
9
10
1
11
2
12
3
13
4
14
5
15
6
16
7
17
8
18
9
19
10
20
2
21
3
22
4
23
5
24
6
25
7
26
8
27
9
28
10
29
11
30
3
31
4
32
5
33
6
34
7
35
8
36
9
37
10
38
11
39
12
40
4
41
5
42
6
43
7
44
8
45
9
46
10
47
11
48
12
49
13
50
5
51
6
52
7
53
8
54
9
55
10
56
11
57
12
58
13
59
14
60
6
61
7
62
8
63
9
64
10
65
11
66
12
67
13
68
14
69
15
70
7
71
8
72
9
73
10
74
11
75
12
76
13
77
14
78
15
79
16
80
8
81
9
82
10
83
11
84
12
85
13
86
14
87
15
88
16
89
17
90
9
91
10
92
11
93
12
94
13
95
14
96
15
97
16
98
17
99
18
100
1
101
2
102
3
103
4
104
5
105
6
106
7
107
8
108
9
109
10
110
2
5100


Fixed submission (verdict: Accepted):
n, a, b = map(int, input().split())
ans = 0
for i in range(n+1):
  str_i = str(i)
  sum_i = 0
  for j in range(len(str_i)):
    sum_i += int(str_i[j])
  if (sum_i >= a) & (sum_i <= b):
    ans+=i
print(ans)

Problem: p03478
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,a,b=map(int,input().split())

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


Failing test case input:
100 1 41

Expected output:
5050


Actual output:
100


Fixed submission (verdict: Accepted):
n,a,b=map(int,input().split())

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

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, A, B = list(map(int, input().split()))
cnt = 0
for i in range(N):
	seq = list(map(int, list(str(i))))
	x = sum(seq)
	if A <= x and x <= B:
		cnt += 1

print(cnt)

Failing test case input:
20 3 6

Expected output:
72


Actual output:
8


Fixed submission (verdict: Accepted):
N, A, B = list(map(int, input().split()))
cnt = 0
for i in range(N + 1):
	seq = list(map(int, list(str(i))))
	x = sum(seq)
	if A <= x and x <= B:
		cnt += i

print(cnt)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,A,B = map(int, input().split())
result_cnt = 0

for i in range(N):
    sum_digit = sum(map(int, list(str(i))))
    
    if (sum_digit >= A) & (sum_digit <= B):
        result_cnt +=  sum_digit

print(result_cnt)


Failing test case input:
111 1 181

Expected output:
6216


Actual output:
957


Fixed submission (verdict: Accepted):
N,A,B = map(int, input().split())
result_cnt = 0

for i in range(1, N + 1):
    sum_digit = sum(map(int, list(str(i))))
    
    if (sum_digit >= A) & (sum_digit <= B):
        result_cnt +=  i

print(result_cnt)
Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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 and res <= b):
        count = count + 1
print(count)

Failing test case input:
100 4 16

Expected output:
4554

Actual output:
87


Fixed submission (verdict: Accepted):
n, a, b = (int(i) for i in input().split())
result = 0
for i in range(1, n + 1):
    res = sum([int(j) for j in str(i)])
    if(a <= res & res <= b):
        result = result + i
print(result)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
37 1 18

Expected output:
703


Actual output:
36


Fixed submission (verdict: Accepted):
n, a, b = (int(i) for i in input().split())
result = 0
for i in range(1, n + 1):
    res = sum([int(j) for j in str(i)])
    if(a <= res & res <= b):
        result = result + i
print(result)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, A, B = list(map(int, input().split()))
cnt = 0
for i in range(N):
	seq = list(map(int, list(str(i))))
	x = sum(seq)
	if A <= x and x <= B:
		cnt += i

print(cnt)

Failing test case input:
110 1 41

Expected output:
6105


Actual output:
5995


Fixed submission (verdict: Accepted):
N, A, B = list(map(int, input().split()))
cnt = 0
for i in range(N + 1):
	seq = list(map(int, list(str(i))))
	x = sum(seq)
	if A <= x and x <= B:
		cnt += i

print(cnt)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b=map(int, input().split())
ret = 0
for i in range(1, n+1):
    c = i 
    if a<=c and c <=b:
        ret += i
print(ret)

Failing test case input:
110 4 011

Expected output:
3426


Actual output:
60


Fixed submission (verdict: Accepted):
n,a,b=map(int, input().split())
ret = 0
for i in range(1, n+1):
    c = eval('+'.join(str(i)))
    if a<=c and c <=b:
        ret += i
print(ret)
Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):



test = "100 4 16"
a, b, c = map(int, test.split())  
x = []
e = []
for i in range(1,a+1):  
    x.append(i)
len_x = len(x)  
d = 0  
f = []  
x = map(str, x) 
x = list(x)
e_number = 0
for i in range(len_x):
    e = x[i]           
    e = list(e)  
    e = map(int, e)
    e = list(e)
    e_number = len(e)   
    d = 0              
    for g in range(e_number):
        d += e[g-1]  
    if b <= d <= c:  
        f.append(x[i])
answer = 0  
f = map(int, f)
for h in f:
    answer += h  
print(answer)

Failing test case input:
37 1 9

Expected output:
590


Actual output:
4554


Fixed submission (verdict: Accepted):



test = input()
a, b, c = map(int, test.split())  
x = []
e = []
for i in range(1,a+1):  
    x.append(i)
len_x = len(x)  
d = 0  
f = []  
x = map(str, x) 
x = list(x)
e_number = 0
for i in range(len_x):
    e = x[i]           
    e = list(e)  
    e = map(int, e)
    e = list(e)
    e_number = len(e)   
    d = 0              
    for g in range(e_number):
        d += e[g-1]  
    if b <= d <= c:  
        f.append(x[i])
answer = 0  
f = map(int, f)
for h in f:
    answer += h  
print(answer)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,A,B = map(int, input().split())

cand = list(range(1, N+1))
cand = list(map(str, cand))
cand = list(map(lambda x: sum(map(int, x)), cand))
cand = list(map(lambda x: x if A <= x <= B else 0, cand))

print(sum(cand))

Failing test case input:
100 5 011

Expected output:
2574


Actual output:
468


Fixed submission (verdict: Accepted):
N,A,B = map(int, input().split())

cand = list(range(1, N+1))
cand = list(map(str, cand))
cand = list(map(lambda x: sum(map(int, x)), cand))
cand = list(map(lambda x: True if A <= x <= B else False, cand))

target = [x for x,t in zip(list(range(1, N+1)), cand) if t]
print(sum(target))

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b = (int(i) for i in input().split())
count = 0

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


Failing test case input:
110 2 010

Expected output:
3354


Actual output:
2409


Fixed submission (verdict: Accepted):
n,a,b = (int(i) for i in input().split())
count = 0

for i in range(1,n+1):
    si = str(i)
    if len(si) == 1:
        s = int(si[0])
    elif len(si) == 2:
        s = int(si[0])+int(si[1])
    elif len(si) == 3:
        s = int(si[0])+int(si[1])+int(si[2])
    else:
        s = int(si[0])+int(si[1])+int(si[2])+int(si[3])

    if a <= s and s <= b:
        count += i
print(count)
Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b  = map(int,input().split())
ans = 0
for i in range(1,n+1):
  d = i
  s = 0
  while d:
    s +=  d % 10
    d = int(d/10)
  if a<=s<=b:
    ans += 1
print(ans)



Failing test case input:
6 2 3

Expected output:
5


Actual output:
2


Fixed submission (verdict: Accepted):
n,a,b  = map(int,input().split())
ans = 0
for i in range(1,n+1):
  d = i
  s = 0
  while d:
    s +=  d % 10
    d = int(d/10)
  if a<=s<=b:
    ans += i
print(ans)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b = map(int, input().split())
sum = 0

for i in range(1, n+1):
    tmpi = 0
    for c in str(i):
        tmpi += int(c)
    if tmpi >= a and b >= tmpi:
        sum += tmpi
print(sum)

Failing test case input:
10 0 4

Expected output:
20


Actual output:
11


Fixed submission (verdict: Accepted):
n, a, b = map(int, input().split())
sum = 0

for i in range(1, n+1):
    tmpi = 0
    for c in str(i):
        tmpi += int(c)
    if tmpi >= a and b >= tmpi:
        sum += i
print(sum)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b  = map(int, input().split())

def sum_digit(x):
    x = sum(int(digit) for digit in str(x))
    if(x<10):
        return x
    else:
        return sum_digit(x)

result = []
for i in range(n+1):   
    z = sum_digit(i)
    if(int(z)<=b and int(z)>=a):
        result.append(i)
        
print(sum(result))        

Failing test case input:
37 1 6

Expected output:
332


Actual output:
445


Fixed submission (verdict: Accepted):
n, a, b  = map(int, input().split())

def sum_digit(x):
    y = sum(int(digit) for digit in str(x))
    return y

result = []
for i in range(n+1):   
    z = sum_digit(i)
    if(int(z)<=b and int(z)>=a):
        result.append(i)
        
print(sum(result))

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,A,B = map(int,input().split())
count=0
for n in range(1,N+1):
    sumn=0
    strn = str(n)
    for lenn in range(len(strn)):
        if lenn == 0:
            sumn += n%10
        else:

            sumn += int(n/10*lenn)%10

    if sumn >= A:
        if sumn <= B:
            count+=n
print(count)

Failing test case input:
111 1 181

Expected output:
6216


Actual output:
6116


Fixed submission (verdict: Accepted):
N,A,B = map(int,input().split())
count=0
for n in range(1,N+1):
    sumn=0
    strn = str(n)
    for lenn in range(len(strn)):
        if lenn == 0:
            sumn += n%10
        else:

            sumn += int(n/(10**lenn))%10

    if sumn >= A:
        if sumn <= B:
            count+=n
print(count)
Problem: p03478
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N,a,b = (int(x) for x in input().split())
z = 0
for I in range (N+1):
    o = 0
    i = I
    while True:
        o += i%10
        i = round (i/10)
        if i == 0:
            if a <= o <= b:
                print (I)
                z += I
            break
print (z)

Failing test case input:
100 1 41

Expected output:
5050


Actual output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
5050


Fixed submission (verdict: Accepted):
import math
N,a,b = (int(x) for x in input().split())
z = 0
for I in range (N):
    o = 0
    i = I+1
    while True:
        o += i%10
        i = math.floor(i/10) 
        if i == 0:
            if a <= o <= b:
                z += I+1
            break
print (z)

Problem: p03478
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, A, B=map(int, input().split())
ans=0
for i in range(1, N+1):
  s=str(i)
  x=0
  for j in s:
    x+=int(j)
    
  if A<=x<=B:
    ans+=1
    
print(ans)

Failing test case input:
10 1 6

Expected output:
31


Actual output:
7


Fixed submission (verdict: Accepted):
N, A, B=map(int, input().split())
ans=0
for i in range(1, N+1):
  s=str(i)
  x=0
  for j in s:
    x+=int(j)
    
  if A<=x<=B:
    ans+=i
    
print(ans)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b = map(int,input().split())
s = 0
for i in range(n):
    x = sum(list(map(int,str(i+1))))
    if a <= x and x <= b:
        s += x
print(s)


Failing test case input:
100 4 16

Expected output:
4554

Actual output:
828


Fixed submission (verdict: Accepted):
n,a,b = map(int,input().split())
s = 0
for i in range(n):
    x = sum(list(map(int,str(i+1))))
    if a <= x and x <= b:
        s += i+1
print(s)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b = list(map(int, input().split()))
isum = 0
for i in range(1,n+1):
    tmp = [int(j) for j in list(str(i))]
    if a <= sum(tmp) <= b:
        isum += sum(tmp)
print(isum)

Failing test case input:
100 2 010

Expected output:
2299


Actual output:
418


Fixed submission (verdict: Accepted):
n,a,b = list(map(int, input().split()))
isum = 0
for i in range(1,n+1):
    tmp = [int(j) for j in list(str(i))]
    
    if a <= sum(tmp) <= b:
        isum += i
print(isum)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


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

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

Failing test case input:
100 5 011

Expected output:
2574


Actual output:
468


Fixed submission (verdict: Accepted):


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

for i in range(n + 1):
    total = sum(list(map(int, list(str(i)))))
    if a <= total <= b:
        answer += i
    
print(answer)
Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b = map(int,input().split(' '))
total = 0
for num in range(1,n+1):
    split_nums = [int(s) for s in list(str(num))]
    sum = 0
    for s in split_nums:
        sum += s
    if a <= sum and sum <= b:
        print(split_nums, sum)
        total += num
print(total)

Failing test case input:
101 5 12

Expected output:
3036


Actual output:
[5] 5
[6] 6
[7] 7
[8] 8
[9] 9
[1, 4] 5
[1, 5] 6
[1, 6] 7
[1, 7] 8
[1, 8] 9
[1, 9] 10
[2, 3] 5
[2, 4] 6
[2, 5] 7
[2, 6] 8
[2, 7] 9
[2, 8] 10
[2, 9] 11
[3, 2] 5
[3, 3] 6
[3, 4] 7
[3, 5] 8
[3, 6] 9
[3, 7] 10
[3, 8] 11
[3, 9] 12
[4, 1] 5
[4, 2] 6
[4, 3] 7
[4, 4] 8
[4, 5] 9
[4, 6] 10
[4, 7] 11
[4, 8] 12
[5, 0] 5
[5, 1] 6
[5, 2] 7
[5, 3] 8
[5, 4] 9
[5, 5] 10
[5, 6] 11
[5, 7] 12
[6, 0] 6
[6, 1] 7
[6, 2] 8
[6, 3] 9
[6, 4] 10
[6, 5] 11
[6, 6] 12
[7, 0] 7
[7, 1] 8
[7, 2] 9
[7, 3] 10
[7, 4] 11
[7, 5] 12
[8, 0] 8
[8, 1] 9
[8, 2] 10
[8, 3] 11
[8, 4] 12
[9, 0] 9
[9, 1] 10
[9, 2] 11
[9, 3] 12
3036


Fixed submission (verdict: Accepted):
n, a, b = map(int,input().split(' '))
total = 0
for num in range(1,n+1):
    split_nums = [int(s) for s in list(str(num))]
    sum = 0
    for s in split_nums:
        sum += s
    if a <= sum and sum <= b:
        total += num
print(total)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b = map(int, input().split())
count = 0
total = 0
for i in range(1,n,1):
    str_i = str(i)
    for j in range(len(str_i)):
        total+=int(str_i[j])
    if total >= a and total <= b:
        count+=i
    total=0
print(count)
    

Failing test case input:
101 2 19

Expected output:
5040


Actual output:
4939


Fixed submission (verdict: Accepted):
n, a, b = map(int, input().split())
count = 0
total = 0
for i in range(1,n+1,1):
    str_i = str(i)
    for j in range(len(str_i)):
        total+=int(str_i[j])
    if total >= a and total <= b:
        count+=i
    total=0
print(count)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b = (int(i) for i in input().split())
result = 0
for i in range(1, n):
    res = sum([int(j) for j in str(i)])
    if(a <= res & res <= b):
        result = result + res
print(result)

Failing test case input:
110 2 100

Expected output:
5994


Actual output:
952


Fixed submission (verdict: Accepted):
n, a, b = (int(i) for i in input().split())
result = 0
for i in range(1, n + 1):
    res = sum([int(j) for j in str(i)])
    if(a <= res & res <= b):
        result = result + i
print(result)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, A, B = map(int, input().split())
ans = 0
for i in range(1, 1+N):
    s = str(i)
    if A <= sum(map(int, s)) <= B:
        ans += 1

print(ans)


Failing test case input:
110 3 110

Expected output:
5750


Actual output:
102


Fixed submission (verdict: Accepted):
N, A, B = map(int, input().split())
ans = 0
for i in range(1, 1+N):
    s = str(i)
    if A <= sum(map(int, s)) <= B:
        ans += i

print(ans)
Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


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

count=0

for i in range(10):
    for j in range(10):
        for k in range(10):
            for l in range(10):
                
                if i+j+k+l>B:
                    break
                elif ((i+j+k+l)>=A and (1000*i+100*j+10*k+l)<=N):
                    count+=1000*i+100*j+10*k+l
                    print(1000*i+100*j+10*k+l)
                    
print(count)                    
    


Failing test case input:
5 -3 10

Expected output:
15


Actual output:
0
1
2
3
4
5
15


Fixed submission (verdict: Accepted):


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

count=0

for h in range(2):
    for i in range(10):
        for j in range(10):
            for k in range(10):
                for l in range(10):
                
                    if h+i+j+k+l>B:
                        break
                    elif ((h+i+j+k+l)>=A and (10000*h+1000*i+100*j+10*k+l)<=N):
                        count+=10000*h+1000*i+100*j+10*k+l
                        

                    
print(count)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b = map(int, input().split())

array = []
for i in range(1, n+1):
    wa = 0
    for s in str(i):
        if int(s)>b: break
        wa += int(s)
    if a<=wa and b>=wa: array.append(i)
print(sum(array))


Failing test case input:
111 0 001

Expected output:
111


Actual output:
5883


Fixed submission (verdict: Accepted):
n, a, b = map(int, input().split())

array = []
for i in range(n+1):
    wa = 0
    for s in str(i):

        wa += int(s)
    if a<=wa and b>=wa: array.append(i)
print(sum(array))

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b = input().split()
S = 0
C = 0

for j in range(1,int(n)+1): 
  j = str(j)
  for i in range(len(j)): 
    S += int(j[i])
  if int(a) <= S <= int(b):
    C += int(j)
  else:
    C += 0

print(C)

Failing test case input:
4 -2 6

Expected output:
10


Actual output:
6


Fixed submission (verdict: Accepted):
n,a,b = input().split()
C = 0

for j in range(1,int(n)+1): 
  j = str(j)
  S = 0
  for i in range(len(j)): 
    S += int(j[i])
  if int(a) <= S <= int(b): 
    C += int(j)
  else:
    C += 0

print(C)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b=map(int,input().split())
ans=0
for i in range(n):
    if a<=sum(map(int,str(i)))<=b: ans+=i
print(ans)

Failing test case input:
4 0 6

Expected output:
10


Actual output:
6


Fixed submission (verdict: Accepted):
n,a,b=map(int,input().split())
ans=0
for i in range(1,n+1):
    if a<=sum(map(int,str(i)))<=b: ans+=i
print(ans)
Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b=map(int,input().split())
c=0
for i in range(1,n+1):
  w=str(i)
  d=0
  for j in range(len(w)):
    d+=int(w[j])
  if a<=d<=b:
    c+=1
print(c)

Failing test case input:
6 -2 6

Expected output:
21


Actual output:
6


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

Problem: p03478
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n, a, b = map(int, input().split())
ans = 0
for num in range(n):
  sum_digit = sum([int(digit) for digit in str(num)])
  if sum_digit <= a and sum_digit >= b:
    ans += num
print(ans)

Failing test case input:
010 3 100

Expected output:
42


Actual output:
0


Fixed submission (verdict: Accepted):
n, a, b = map(int, input().split())
ans = 0
for num in range(n + 1):
  sum_digit = sum([int(digit) for digit in str(num)])
  if sum_digit >= a and sum_digit <= b:
    ans += num
print(ans)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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 += cnt

print(total) 
    


Failing test case input:
17 -2 2

Expected output:
24


Actual output:
13


Fixed submission (verdict: Accepted):
n, a, b = map(int, input().split())
 
sum = 0
for i in range(n+1) :
    count = 0
    for num in str(i) :
        count += int(num)
 
    if (count >= a) and (count <= b) :
        sum += i
            
print(sum)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b= map(int, input().split())
ans = 0
for i in range(1, n+1):
    if a <=  sum([int(c) for c in str(i)]) <= b:
        ans += 1
print(ans)


Failing test case input:
110 4 34

Expected output:
5582


Actual output:
97


Fixed submission (verdict: Accepted):
n, a, b= map(int, input().split())
ans = 0
for i in range(1, n+1):
    if a <=  sum([int(c) for c in str(i)]) <= b:
        ans += i
print(ans)

Problem: p03478
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N, A, B = map(int, input().split())

Num = 0
for i in range(1, N+1):
    List = [int(a) for a in list(str(i))]
    if A <= sum(List) <= B:
        Num += 1

print(Num)


Failing test case input:
21 0 8

Expected output:
185


Actual output:
18


Fixed submission (verdict: Accepted):
N, A, B = map(int, input().split())

Num = 0
for i in range(1, N+1):
    List = [int(a) for a in list(str(i))]
    if A <= sum(List) <= B:
        Num += i

print(Num)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, A, B = map(int, input().split())
ans = 0
for i in range(N+1):
    tmp = sum([int(j) for j in str(i)])
    if(A <= tmp <= B):
        ans += 1
print(ans)

Failing test case input:
001 -2 9

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
N, A, B = map(int, input().split())
ans = 0
for i in range(N+1):
    tmp = sum([int(j) for j in str(i)])
    if(A <= tmp <= B):
        ans += i
print(ans)
Problem: p03478
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
sum = 0
N,A,B = list(map(int,input().split()))
for i in range(1,N+1):
    num=0
    s = str(i)
    for j in range(len(s)):
        num+=int(s[j-1])
    if A<=num<=B:
        sum+=i
        print(i)
print(sum)


Failing test case input:
111 0 001

Expected output:
111


Actual output:
1
10
100
111


Fixed submission (verdict: Accepted):
sum = 0
N,A,B = list(map(int,input().split()))
for i in range(1,N+1):
    num=0
    s = str(i)
    for j in range(len(s)):
        num+=int(s[j-1])
    if A<=num<=B:
        sum+=i
print(sum)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = list(map(int, input().split()))
ans = 0
for i in range(a[0]+1):
    num = [int(c) for c in str(i)]
    if (sum(num) >= a[1]) & (a[2] >= sum(num)) :
        print(i)
        ans += i
print(ans)

Failing test case input:
17 -2 2

Expected output:
24


Actual output:
0
1
2
10
11
24


Fixed submission (verdict: Accepted):
a = list(map(int, input().split()))
ans = 0
for i in range(a[0]+1):
    num = [int(c) for c in str(i)]
    if (sum(num) >= a[1]) & (a[2] >= sum(num)) :
        ans += i
print(ans)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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:
        print(i)
        ans +=i
print(ans)

Failing test case input:
001 0 13

Expected output:
1


Actual output:
1
1


Fixed submission (verdict: Accepted):
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)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,A,B=map(int,input().split())
counter=0
for i in range(N):
  n=str(i+1)
  s=len(n)
  n_total=0
  for t in range(s):
    n_total+=int(n[t])
  if A<= n_total <=B:
    counter+=1
print(counter)

Failing test case input:
37 1 2

Expected output:
44


Actual output:
5


Fixed submission (verdict: Accepted):
N,A,B=map(int,input().split())
counter=0
for i in range(N):
  n=str(i+1)
  s=len(n)
  n_total=0
  for t in range(s):
    n_total+=int(n[t])
  if A<= n_total <=B:
    counter+=int(i+1)
print(counter)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, A, B = map(int, input().split())

def wa(n):
    w = 0
    while n != 0:
        w += n % 10
        n = int(n / 10)
    return w

ans = 0
for i in range(1, N):
    w = wa(i)
    if A <= w and w <= B:
        ans += 1

print(ans)


Failing test case input:
110 3 010

Expected output:
3110


Actual output:
66


Fixed submission (verdict: Accepted):
N, A, B = map(int, input().split())

def wa(n):
    w = 0
    while n != 0:
        w += n % 10
        n = int(n / 10)
    return w

ans = 0
for i in range(1, N+1):
    w = wa(i)
    if A <= w and w <= B:
        
        ans += i

print(ans)
Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
num = input().split(" ")
N=int(num[0])
A=int(num[1])
B=int(num[2])

num = 0
for i in range(1,N+1):
    s = str(i)
    t=0
    for ii in s:
        t+=int(ii)
    if t>=A and t<=B:
        num+=1
print(num)

Failing test case input:
010 8 010

Expected output:
17


Actual output:
2


Fixed submission (verdict: Accepted):
num = input().split(" ")
N=int(num[0])
A=int(num[1])
B=int(num[2])

num = 0
for i in range(1,N+1):
    s = str(i)
    t=0
    for ii in s:
        t+=int(ii)
    if t>=A and t<=B:
        num+=i
print(num)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b = map(int, input().split())

cnt = 0
for i in range(1, n + 1):
  str_n = str(n)
  sum_n = sum(map(int, str_n))
  cnt += a <= sum_n <= b
  
print(cnt)

Failing test case input:
10 2 4

Expected output:
9


Actual output:
0


Fixed submission (verdict: Accepted):
n, a, b = map(int, input().split())

cnt = 0
for i in range(1, n + 1):
    str_i = str(i)
    sum_i = sum(map(int, str_i))
    cnt += (a <= sum_i <= b) * i

print(cnt)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b = map(int, input().split())
ans = 0
for i in range(n+1):
    c = list(map(int, list(str(i))))
    c = sum(c)
    if a <= c <= b:
        ans +=1
print(ans)

Failing test case input:
101 1 011

Expected output:
2995


Actual output:
73


Fixed submission (verdict: Accepted):
n, a, b = map(int, input().split())
ans = 0
for i in range(n+1):
    c = list(map(int, list(str(i))))
    c = sum(c)
    if a <= c <= b:
        ans += i
print(ans)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


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

cnt = 0
for i in range(n):
  str_i = str(i)
  sum = 0
  for char in str_i:
    sum += int(char)
  if sum >= a and sum <= b:
    cnt += 1
    
print(cnt)

Failing test case input:
011 -1 110

Expected output:
66


Actual output:
11


Fixed submission (verdict: Accepted):


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

total = 0
for i in range(1, n + 1):
  str_i = str(i)
  sum = 0
  for char in str_i:
    sum += int(char)
  if sum >= a and sum <= b:
    total += i
    
print(total)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, A, B = map(int, input().split(" "))
sum_total = 0
for n in range(1, N + 1):
    sum = 0
    for s in str(n):
        sum += int(s)
    if A <= sum and sum <= B:
        sum_total += sum
print(sum_total)

Failing test case input:
101 1 010

Expected output:
2511


Actual output:
423


Fixed submission (verdict: Accepted):
N, A, B = map(int, input().split(" "))
sum_total = 0
for n in range(1, N + 1):
    sum = 0
    for s in str(n):
        sum += int(s)
    if A <= sum and sum <= B:
        sum_total += n
print(sum_total)
Problem: p03478
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,a,b=map(int,input().split())
ans=0
for i in range(1,a+1):
    k=list(str(i))
    m=list(map(int,k))
    if a<=sum(m)<=b:
        ans+=i
print(ans)

Failing test case input:
110 3 110

Expected output:
5750


Actual output:
3


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())
ans=0
for i in range(1,a+1):
    n=list(str(i))
    m=list(map(int,n))
    if b<=sum(m)<=c:
        ans+=i
print(ans)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
37 1 3

Expected output:
110


Actual output:
9


Fixed submission (verdict: Accepted):
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)

Problem: p03478
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,a,b = map(int, input().split())

def s(sum,a,b):
    t = 0
    if sum >= a and sum <= b:
        t = 1
    return t

num = 0
for i in range(1,n+1):
    sum = int(i/10 + i%10)
    if s(sum,a,b) == 1:
        num += i
print(num)


Failing test case input:
100 5 011

Expected output:
2574


Actual output:
2674


Fixed submission (verdict: Accepted):
n,a,b = map(int, input().split())

def s(sum,a,b):
    t = 0
    if sum >= a and sum <= b:
        t = 1
    return t

def S(i):
    sum = 0
    while i > 0:
        sum += i%10
        i = int(i/10)
    return sum

num = 0
for i in range(1,n+1):
    sum = S(i)
    if s(sum,a,b) == 1:
        num += i
print(num)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):



n = list(map(int,input().split()))

def main(n,a,b):
    somesum = 0

    for i in range(1,(n+1)):
        x = int(i/10)
        y = i % 10
        s = x + y
        if a <= s and s <= b:
            somesum += i
    print(somesum)

main(n[0],n[1],n[2])

Failing test case input:
100 3 011

Expected output:
2750


Actual output:
2850


Fixed submission (verdict: Accepted):



n = list(map(int,input().split()))

def main(n,a,b):
    somesum = 0
    for i in range(1,(n+1)):
        x = [0]*5
        for j in range(1,5):
            x[j] = int(i/(10**j)) % 10
            x[0] = i % 10
            s = sum(x)
        if a <= s <= b:
            somesum += i
    print(somesum)
main(n[0],n[1],n[2])

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,A,B=map(int,input().split())
ls=[]

for i in range(N):
    x=i
    y=i%10
    if x+y>=A and x+y<=B:
        ls.append(i)

print(sum(ls))

Failing test case input:
37 1 2

Expected output:
44


Actual output:
1


Fixed submission (verdict: Accepted):
N,A,B=map(int,input().split())
ans=0

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

print(ans)
Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b=map(int,input().split())
ans=0
for i in range(1,n+1):
  if a <= sum(map(int,str(i))) <= b:
    ans+=1
print(ans)    


Failing test case input:
011 -1 110

Expected output:
66


Actual output:
11


Fixed submission (verdict: Accepted):
n,a,b=map(int,input().split())
ans=0
for i in range(1,n+1):
  if a <= sum(map(int,str(i))) <= b:
    ans+=i
print(ans)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x,y,z = map(int,input().split())
count = 0
for i in range(1,x) :
    LIST = [int(x) for x in list(str(i))]
    if y <sum(LIST) <z :
        count +=1       
print(count)

Failing test case input:
110 1 41

Expected output:
6105


Actual output:
106


Fixed submission (verdict: Accepted):
x,y,z = map(int,input().split())
count = 0
for i in range(1,x+1) :
    LIST = [int(x) for x in list(str(i))]
    if y <=sum(LIST) <=z :
        count += i       
print(count)

Problem: p03478
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,a,b = map(int, input().split())
cnt = 0

def digidsum(x):
  s = str(n)
  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)

Failing test case input:
111 1 011

Expected output:
4060


Actual output:
6216


Fixed submission (verdict: Accepted):
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)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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:
		print(i)
		count += i

print(count)

Failing test case input:
001 0 12

Expected output:
1


Actual output:
1
1


Fixed submission (verdict: Accepted):
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)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b  = map(int,input().split())
ans = 0
for i in range(1,n+1):
  d = i
  s = 0
  while d:
    s +=  d % 10
    d = int(d/10)
  if a<=s<=b:
    ans += i



Failing test case input:
001 3 12

Expected output:
0


Actual output:

Fixed submission (verdict: Accepted):
n,a,b  = map(int,input().split())
ans = 0
for i in range(1,n+1):
  d = i
  s = 0
  while d:
    s +=  d % 10
    d = int(d/10)
  if a<=s<=b:
    ans += i
print(ans)
Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = map(int, input().split())
a2 = 0
l = []

while a > 0:
    a1 = a
    while a1 > 1:
        l.append(int(a1 % 10))
        a1 = a1 / 10
    if sum(l) >= b and sum(l) <= c:
        a2 = a2 + a
    l = []
    a = a - 1
print(a2)


Failing test case input:
10 1 6

Expected output:
31


Actual output:
20


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split())
a2 = 0

while a > 0:
    a1 = a
    l = []
    while a1 >= 1:
        l.append(int(a1 % 10))
        a1 = a1 / 10
    if sum(l) >= b and sum(l) <= c:
        a2 = a2 + a

    a = a - 1
print(a2)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, A, B = list(map(int,input().split()))

count = 0
for i in range(1, N+1):
  a = i 
  b = i % 10
  if A <= a + b <= B:
    count += i
    
print(count)

Failing test case input:
37 1 9

Expected output:
590


Actual output:
10


Fixed submission (verdict: Accepted):
N, A, B = list(map(int,input().split()))

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

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b = map(int, input().split())
count = 0
total = 0
for i in range(1,21,1):
    str_i = str(i)
    for j in range(len(str_i)):
        total+=int(str_i[j])
    if total >= a and total <= b:
        count+=i
    total=0
print(count)

Failing test case input:
100 5 011

Expected output:
2574


Actual output:
134


Fixed submission (verdict: Accepted):
n, a, b = map(int, input().split())
count = 0
total = 0
for i in range(1,n+1,1):
    str_i = str(i)
    for j in range(len(str_i)):
        total+=int(str_i[j])
    if total >= a and total <= b:
        count+=i
    total=0
print(count)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b = map(int, input().split())

t = 0
for i in range(1, n+1):
    ans = 0
    while i!=0:
        amari = i%10
        i = int(i/10)
        ans += amari
    if a <= ans <= b:
        t += 1
print('t=', t)


Failing test case input:
101 2 19

Expected output:
5040


Actual output:
t= 98


Fixed submission (verdict: Accepted):
n, a, b = map(int, input().split())

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

Problem: p03478
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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 += 1
print(K)
    



Failing test case input:
100 3 011

Expected output:
2750


Actual output:
66


Fixed submission (verdict: Accepted):
N,A,B = map(int,input().split())
K = 0
for i in range(1,N+1):
  if A <= sum(map(int,str(i))) <= B:
    K += i
print(K)
Problem: p03478
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, A, B = map(int, input().split())

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

Failing test case input:
6 -2 6

Expected output:
21


Actual output:
0
1
2
3
4
5
6
21


Fixed submission (verdict: Accepted):
N, A, B = map(int, input().split())

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

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b=map(int,input().split())
counter=0
for m in range(1,n):
  s=str(m)
  array=list(map(int,s))
  if a<=sum(array)<=b:
    counter+=m
print(counter)
  

Failing test case input:
5 -3 10

Expected output:
15


Actual output:
10


Fixed submission (verdict: Accepted):
n,a,b=map(int,input().split())
counter=0
for m in range(1,n+1):
  s=str(m)
  array=list(map(int,s))
  if a<=sum(array)<=b:
    counter+=m
print(counter)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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

print(total) 
    


Failing test case input:
37 1 6

Expected output:
332


Actual output:
953


Fixed submission (verdict: Accepted):
n, a, b = map(int, input().split())
 
sum = 0
for i in range(n+1) :
    count = 0
    for num in str(i) :
        count += int(num)
 
    if (count >= a) and (count <= b) :
        sum += i
            
print(sum)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, A, B = map(int, input().split())

def find_sum_of_digits(n):
  sum = 0
  while n >0:
    sum = sum + n%10
    n = n/10
  return sum

total = 0
for number in range(1,N+1):
  all_sum = find_sum_of_digits(number)
  
  if A <= all_sum and all_sum <= B+1:
    total = total + number

print(total)  

   
    

Failing test case input:
100 3 010

Expected output:
2266


Actual output:
1771


Fixed submission (verdict: Accepted):
N, A, B = map(int, input().split())

def find_sum_of_digits(n):
  s = str(n)
  sum = 0
  

  for i in range(0,len(str(n))):
    sum = sum + int(s[i])
  return sum

total = 0
for number in range(1,N+1):
  all_sum = find_sum_of_digits(number)
  if A <= all_sum and all_sum <= B:
    total = total + number

print(total)

Problem: p03478
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b=map(int, input().split())
ret = 0
for i in range(1, n+1):
  c = n 
  if a<=c and c <=b:
    ret += 1
print(ret)


Failing test case input:
011 -1 110

Expected output:
66


Actual output:
11


Fixed submission (verdict: Accepted):
n,a,b=map(int, input().split())
ret = 0
for i in range(1, n+1):
    c = eval('+'.join(str(i)))
    if a<=c and c <=b:
        ret += i
print(ret)