sum-of-digits-8

The problems is to find the count of numbers between A and B (inclusive) that have sum of digits equal to S.

Also print the smallest such number between A and B (inclusive).

Input:

Single line consisting of A,B,S.

Output:

Two lines.

In first line the number of integers between A and B having sum of digits equal to S.

In second line the smallest such number between A and B.

Constraints:

1 ≤ A ≤ B < 10^15

1 ≤ S ≤ 135

SAMPLE INPUT
5 17 5

SAMPLE OUTPUT
2
5

Source: hackerearth | Difficulty: HARD
Tags: Dynamic programming

Mathematics


Solutions: