Factorial Digit Count
Time limit1sMemory limit128 MB
Given N, list every positive integer X for which X! has exactly N decimal digits, or report that none exists.
- Level
Medium6 of 10
- Topics
- Math, Binary search, Number theory, Implementation
- Solved
- No attempts yet
Problem
Given a positive integer , find every positive integer such that (that is, ) has exactly decimal digits. Such an may not exist. You may assume .
Input
The first line of input contains a single positive integer .
Output
If no such exists, print the string NO on the first line. Otherwise, print on the first line how many values of satisfy the condition, then print all such in increasing order, one per line.