#888
Gold IV
ČUDAK
시간 제한
1s
메모리 제한
32MB
제출
3
정답
1
맞힌 사람
1
정답 비율
33.3%

문제

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 < 10^15, 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

1
5

예제 입력 2

1 100 10

예제 출력 2

9
19

예제 입력 3

11111 99999 24

예제 출력 3

5445
11499
코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
#순위사용자언어시간메모리코드 길이
5669🥇
안우진
Python8ms8900KB830B
난이도 투표
Gold IV1명 투표· 약 1개월 전
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
#사용자문제결과언어시간메모리코드 길이제출 시간
5669
맞았습니다
Python8ms8900KB830B2026. 04. 29. 00:45
5668
시간 초과
Python--793B2026. 04. 29. 00:41
5667
시간 초과
Python--305B2026. 04. 28. 21:56