time limit per test: 0.25 sec. memory limit per test: 4096 KB
input: standard input output: standard output
You task is to find minimal natural number N, so that N! contains exactly Q zeroes on the trail in decimal notation. As you know N! = 1*2*...*N. For example, 5! = 120, 120 contains one zero on the trail.
One number Q written in the input (0<=Q<=10^8).
Write "No solution", if there is no such number N, and N otherwise.
Andrew V. Lazarev
Saratov Subregional School Team Contest, 2002
Codeforces (c) Copyright 2010-2019 Mike Mirzayanov