Page numbering
For numbering of M pages in the book N digits were used. By given N output corresponding M or 0, if there is no solution. Numbering starts from first page.
Specifications
Input
The only number N. The book is not more than 1001 pages.
Output
The desired number of pages.
Problem information
Time Limit: 1 secondsMemory Limit: 64 MB
Balls for the passed test: 6.66667
Complexity: 34% 380/580
Classes: Simple mathematics
Example
Example input27 |
Example output18 |
| ← Median number | Problems | Game → |
