Pagini recente » Diferente pentru problema/texttrim intre reviziile 21 si 20 | Diferente pentru problema/gordonramsay intre reviziile 32 si 19 | Cod sursa (job #1171273) | Cod sursa (job #1066978) | Cod sursa (job #1075559)
#include <fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
long long nrz(long long x){
long long s=0;
while(x>0){
s=s+x/5;
x=x/5;
}
return s;
}
int main()
{
long long i=0,pas=1<<20,n;
f>>n;
while(pas!=0){
if(nrz(i+pas)<=n-1)
i+=pas;
pas/=2;
}
g<<i+1;
return 0;
}