Pagini recente » Istoria paginii runda/preoni2008_clasa_a9-a_runda1/clasament | Cod sursa (job #1623798) | Cod sursa (job #1868914) | Cod sursa (job #940139) | Cod sursa (job #1268639)
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin ("fact.in");
ofstream fout ("fact.out");
long _div(long x)
{
long d = 5, rez = 0;
while (x / d)
{
rez += x / d;
d *= 5;
}
return rez;
}
int main()
{
long aux, n, x = 0, f = 1;
fin >> n;
if (n == 0)
fout << 1;
else
{
while (true)
{
if (_div(f) == n)
{
fout << f;
break;
}
f++;
}
}
return 0;
}