Pagini recente » Cod sursa (job #632669) | Cod sursa (job #197864) | Cod sursa (job #632648) | Cod sursa (job #1651930) | Cod sursa (job #1934068)
#include <iostream>
#include <cstdio>
using namespace std;
FILE*fin=fopen("fact.in","r");
FILE*fout=fopen("fact.out","w");
int main()
{
long long n , p , k = 0 , x , i , k1 = 0 , j ;
cin >> p ;
for ( i = 1 ; i <= p * 5 ; ++i )
{
if ( i % 5 == 0 )
{
x = i ;
if ( ( i / 5 ) % 5 == 0 )
{
while ( x % 5 == 0 )
{
++k ;
x /= 5 ;
}
}
else ++k ;
if ( k >= p ) break ;
}
}
if ( k == p ) cout << i ;
else cout << "-1" ;
return 0;
}