Cod sursa(job #1994719)
Utilizator | Data | 25 iunie 2017 19:45:13 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.27 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("fact.in");
ofstream l("fact.out");
long long p,n;
int main()
{
cin>>p;
n=5*p-p/6*5;
p++;
if (n==5*p-p/6*5)
cout<<-1;
else
cout<<n;
return 0;
}