#P6356. [COCI 2007/2008 #3] CUDAK
[COCI 2007/2008 #3] CUDAK
Problem Description
Find how many integers in the interval have a digit sum equal to . Also, find the smallest such integer.
Input Format
Input one line with three integers .
Output Format
Output two lines. The first line is the count of such integers, and the second line is the smallest such integer.
The input guarantees that there is at least one such number.
1 9 5
1
5
1 100 10
9
19
11111 99999 24
5445
11499
Hint
Constraints
For of the testdata, , .
Notes
Translated from COCI2007-2008 CONTEST #3 T5 CUDAK.
Translated by ChatGPT 5