← All problemsSign in

Writing Numbers

CSESAdditional Problems IOpen on judge ↗

You would like to write a list of positive integers 1,2,3,\ldots using your computer. However, you can press each key 0–9 at most n times during the process. What is the last number you can write? Input The only input line contains the value of n. Output Print the last number you can write. Constraints - 1 \le n \le 10^{18} Example Input: 5 Output: 12 Explanation: You can write the nu

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start