P6356 [COCI 2007/2008 #3] CUDAK

Description

Find how many integers in the interval $[A,B]$ have a digit sum equal to $S$. Also, find the smallest such integer.

Input Format

Input one line with three integers $A,B,S$.

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.

Explanation/Hint

#### Constraints For $100\%$ of the testdata, $1\le A,B\le 10^{15}$, $1\le S\le 135$. #### Notes **Translated from [COCI2007-2008](https://hsin.hr/coci/archive/2007_2008/) [CONTEST #3](https://hsin.hr/coci/archive/2007_2008/contest3_tasks.pdf) *T5 CUDAK***. Translated by ChatGPT 5