Cod sursa(job #1610901)
Utilizator | Data | 23 februarie 2016 20:10:06 | |
---|---|---|---|
Problema | Factorial | Scor | 5 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.26 kb |
#include <fstream>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
long long int p,n;
int main()
{
fin>>p;
if(p%6==5)
fout<<-1;
else
{
n=(p/6)*25+(p%6)*5;
fout<<n;
}
return 0;
}