codeforces-scrape

Codeforces scraped problems and editorials
git clone git://git.laack.co/codeforces-scrape.git
Log | Files | Refs | README

552B.md (1032B)


      1 Source: https://codeforces.com/problemset/problem/552/B
      2 
      3 B. Vanya and Books
      4 
      5 time limit per test
      6 
      7 1 second
      8 
      9 memory limit per test
     10 
     11 256 megabytes
     12 
     13 input
     14 
     15 standard input
     16 
     17 output
     18 
     19 standard output
     20 
     21 Vanya got an important task — he should enumerate books in the library and label each book with its number. Each of the *n* books should be assigned with a number from 1 to *n*. Naturally, distinct books should be assigned distinct numbers.
     22 
     23 Vanya wants to know how many digits he will have to write down as he labels the books.
     24 
     25 Input
     26 
     27 The first line contains integer *n* (1 ≤ *n* ≤ 109) — the number of books in the library.
     28 
     29 Output
     30 
     31 Print the number of digits needed to number all the books.
     32 
     33 Examples
     34 
     35 Input
     36 
     37 ```
     38 13
     39 ```
     40 
     41 Output
     42 
     43 ```
     44 17
     45 ```
     46 
     47 Input
     48 
     49 ```
     50 4
     51 ```
     52 
     53 Output
     54 
     55 ```
     56 4
     57 ```
     58 
     59 Note
     60 
     61 Note to the first test. The books get numbers 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, which totals to 17 digits.
     62 
     63 Note to the second sample. The books get numbers 1, 2, 3, 4, which totals to 4 digits.