Pagini recente » Cod sursa (job #1130260) | Cod sursa (job #1104620) | Cod sursa (job #620368) | Cod sursa (job #2063162) | Cod sursa (job #1595985)
#include <cstdio>
using namespace std;
int main()
{
int p,rez=0,cop;
freopen("fact.in", "r", stdin);
freopen("fact.out", "w", stdout);
scanf("%d", &p);
if(p==0)
printf("%d", 1);
else
for(int i=5; i<=100000000; i+=5)
{
cop = i;
while(cop%5==0)
cop /= 5, rez++;
if(rez==p)
{
printf("%d", i);
return 0;
}
else if(rez>p)
{
printf("%d", -1);
return 0;
}
}
}