Problem:
 Score : 200 points    Problem Statement Find the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).      Constraints  1 \leq N \leq 10^4  1 \leq A \leq B \leq 36  All input values are integers.         Input Input is given from Standard Input in the following format:  N  A  B       Output Print the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).        Sample Input 1 20 2 5      Sample Output 1 84  Among the integers not greater than 20 , the ones whose sums of digits are between 2 and 5 , are: 2,3,4,5,11,12,13,14 and 20 . We should print the sum of these, 84 .       Sample Input 2 10 1 2      Sample Output 2 13       Sample Input 3 100 4 16      Sample Output 3 4554

Solution (Python):


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

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

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

print(c)

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

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

Solution (Python):
import sys

line = sys.stdin.readline().strip()
N, A, B = [int(x) for x in line.split()]

r = 0
for i in range(1, N + 1):
    s = str(i)
    csum = sum(int(c) for c in s)
    if A <= csum <= B:
        r += i

print(r)

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

print(ans)

Solution (Python):
import math

def digit_sum(x, y):
    if x < y:
        return x
    else:
        return digit_sum(math.floor(x/y), y) + (x % y)

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

for i in range(1, n + 1):
    if a <= digit_sum(i, 10) <= b:
        ans += i

print ans

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

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

print(ans)

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

print(ans)

Solution (Python):
n, a, b = map(int, raw_input().split())
print sum([i for i in xrange(1, n+1) if a <= sum(map(int, list(str(i)))) <= b])

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

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

Solution (Python):
import sys
n, a, b = map(int, sys.stdin.readline().split())

def sumDigits(x):
    s = 0
    while x > 0:
        s += x % 10
        x = x // 10
    return s

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

print(s)

Solution (Python):
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)