CUDAK
시간 제한: 1000ms메모리 제한: 128MB출처: COCI 2007-2008BOJ 3001
문제
Božo is a strange little boy. Every day he tires his friends with strange questions. Today's question is: how many integers in the interval [A, B] are there such that the sum of their digits is S, and which is the smallest such number?
Write a program that answers Božo's question so that he can get some sleep.
입력
The input contains three integers A, B and S (1 ≤ A ≤ B < 1015, 1 ≤ S ≤ 135).
출력
The first line should contain the number of integers in the interval with the digit sum equal to S.
The second line should contain the smallest such integer.
The input data will guarantee that the first number is at least 1.
예제
예제 1
입력
1 9 5
출력
1 5
예제 2
입력
1 100 10
출력
9 19
예제 3
입력
11111 99999 24
출력
5445 11499
코드를 제출하려면 로그인하세요.