#C11876. Renovation Addresses

    ID: 41240 Type: Default 1000ms 256MiB

Renovation Addresses

Renovation Addresses

You are given an integer T representing the number of test cases. For each test case, you are given three integers a, b and P, representing an inclusive range [a, b] and a target digit sum P respectively. Your task is to find all numbers in the range [a, b] such that the sum of its digits equals P. If there is no number in the range that satisfies the condition, output "No houses will be renovated".

The digit sum function is defined as follows: \[ S(n) = \sum_{i=1}^{k} d_i \] where \(d_i\) are the digits of \(n\).

Print the results for each test case on a new line. For each test case, if there are qualifying numbers, output them separated by a single space.

inputFormat

The input is read from standard input (stdin) and has the following format:

T
a1 b1 P1
a2 b2 P2
... 
 aT bT PT

Where T is the number of test cases. For each test case, a and b define the range [a, b] and P is the target digit sum.

outputFormat

For each test case, output a single line containing the qualifying addresses separated by a single space. If no address qualifies, output "No houses will be renovated".

The output should be written to standard output (stdout).

## sample
3
10 20 2
50 60 5
100 115 7
11 20

50 106 115

</p>