#BS0000075. Mua một số nguyên (Buy an Integer)
Mua một số nguyên (Buy an Integer)
Buy an Integer
Source: AtCoder
Version: Phuoc Hung OJ Extended
Problem Statement
Integers are sold. Integer costs where is its decimal digit count. With budget , find the greatest affordable integer, or 0 if none.
Input
The only line contains .
Output
Print the greatest affordable integer or 0.
Subtasks
- Subtask 1 — 20%: .
- Subtask 2 — 30%: .
- Subtask 3 — 50%: , .
Example
Input
10 7 100
Output
9
Explanation
9 costs 97, while 10 costs 114.