First Number

View as PDF

Submit solution


Points: 0.08 (partial)
Time limit: 0.38s
Memory limit: 512M
Input: stdin
Output: stdout

Problem source:
COI 04
Problem type
Allowed languages
C, C++, Go, Java, Kotlin, Pascal, PyPy, Python, Rust, Scratch

Viết các số thập phân ~1~, ~2~, ...liên tiếp thu được dãy số như sau:

~12345678910111213141516171819202122~ ...

etc. Viết chương trình tìm vị trí xuất hiện đầu tiên của số ~N~ trong dãy trên.

Input

Gồm duy nhất ~1~ số ~N~, ~1 \leq N \leq 100~, ~000~.

Output

Số duy nhất là vị trí xuất hiện đầu tiên của số ~N~ trong dãy.

Sample Input 1

15

Sample Output 1

20

Sample Input 2

34

Sample Output 2

3

Sample Input 3

142

Sample Output 3

73

Comments

Please read the guidelines before commenting.


There are no comments at the moment.