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