codeforces-scrape

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

633B.md (1122B)


      1 Source: https://codeforces.com/problemset/problem/633/B
      2 
      3 B. A Trivial Problem
      4 
      5 time limit per test
      6 
      7 2 seconds
      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 Mr. Santa asks all the great programmers of the world to solve a trivial problem. He gives them an integer *m* and asks for the number of positive integers *n*, such that the factorial of *n* ends with exactly *m* zeroes. Are you among those great programmers who can solve this problem?
     22 
     23 Input
     24 
     25 The only line of input contains an integer *m* (1 ≤ *m* ≤ 100 000) — the required number of trailing zeroes in factorial.
     26 
     27 Output
     28 
     29 First print *k* — the number of values of *n* such that the factorial of *n* ends with *m* zeroes. Then print these *k* integers in increasing order.
     30 
     31 Examples
     32 
     33 Input
     34 
     35 ```
     36 1
     37 ```
     38 
     39 Output
     40 
     41 ```
     42 5  
     43 5 6 7 8 9
     44 ```
     45 
     46 Input
     47 
     48 ```
     49 5
     50 ```
     51 
     52 Output
     53 
     54 ```
     55 0
     56 ```
     57 
     58 Note
     59 
     60 The factorial of *n* is equal to the product of all integers from 1 to *n* inclusive, that is *n*! = 1·2·3·...·*n*.
     61 
     62 In the first sample, 5! = 120, 6! = 720, 7! = 5040, 8! = 40320 and 9! = 362880.