Pagini recente » Cod sursa (job #3213606) | Cod sursa (job #1629081) | Cod sursa (job #1942763) | Cod sursa (job #1156406) | Cod sursa (job #1326911)
#include <fstream>
using namespace std;
int main()
{
long long p;
ifstream fin("fact.in");
fin >> p;
fin.close();
ofstream fout("fact.out");
if(p == 0) fout << 1;
else if(p <= 5) fout << p * 5;
else if(p <= 25) fout << (p - 1) * 5;
else if(p <= 125) fout << (p - 2) * 5;
else if(p <= 625) fout << (p - 3) * 5;
else if(p <= 3125) fout << (p - 4) * 5;
else if(p <= 15625) fout << (p - 5) * 5;
else if(p <= 78125) fout << (p - 6) * 5;
else if(p <= 390625) fout << (p - 7) * 5;
else if(p <= 1953125) fout << (p - 8) * 5;
else if(p <= 9765625) fout << (p - 9) * 5;
else if(p <= 48828125) fout << (p - 10) * 5;
else if(p <= 244140625) fout << (p - 11) * 5;
else if(p <= 1220703125) fout << (p - 12) * 5;
fout.close();
return 0;
}