| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 (추가 시간 없음) | 512 MB | 98 | 24 | 21 | 29.577% |
You are given a number $N$ and a digit $d$. Consider all numbers which do not contain digit $d$ in their decimal notation. Find the minimum such number for which the sum of its digits is exactly $N$.
The first line contains two integers $N$ and $d$ ($2 \le N \le 10^{6}$, $0 \le d \le 9$).
Print one integer: the minimum number which does not contain digit $d$ and has the sum of its digits equal to $N$.
14 9
68