Programming Task: Sum of Integers Based on Digit Sum
Problem Statement
You are required to find the sum of all integers between 1 and ( N ) (inclusive) whose sum of digits (when written in base 10) falls between ( A ) and ( B ) (inclusive).
Input Format
Input will consist of three integers:
( N ): The upper limit of the range (1 ≤ ( N ) ≤ 10^6)
( A ): The lower bound for the sum of digits (0 ≤ ( A ) ≤ 81)
( B ): The upper bound for the sum of digits (0 ≤ ( B ) ≤ 81)
Output Format
Output a single integer representing the sum of all integers from 1 to ( N ) whose sum of digits is between ( A ) and ( B ) (inclusive).
Example
Input
text
N = 20
A = 2
B = 5
Output
text
57
Explanation
The integers between 1 and 20 whose digit sums fall between 2 and 5 are:
2 (sum = 2)
3 (sum = 3)
4 (sum = 4)
5 (sum = 5)
11 (sum = 2)
12 (sum = 3)
13 (sum = 4)
14 (sum = 5)
20 (sum = 2)
The sum of these integers is ( 2 + 3 + 4 + 5 + 11 + 12 + 13 + 14 + 20 = 57 ).
Constraints
The sum of digits for any integer between 1 and ( N ) can range from 0 (for the number 0) up to 81 (for numbers like 999999).
Solution Directory
The solution should be placed in the /app/ directory.
Important: place your implementation at /app/solution.py so the verifier can run it.