Cod sursa(job #2402417)
Utilizator | Curca Vadim VadimC | Data | 10 aprilie 2019 17:59:19 |
---|---|---|---|
Problema | Factorial | Scor | 5 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.27 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int n, p;
int main(){
int i, pz;
fin >> p;
if((25 * (p + 1) / 6) % 25 == 0) cout << -1;
else
fout << (int)(25.0 * p / 6 + 4.99999) / 5 * 5;
}