Pagini recente » Diferente pentru preoni-2007/runda-4/solutii intre reviziile 11 si 10 | Rating Bizdoc Vasile Gabriel (Gabryel9898) | algoritmiada-2019/runda-preoji/solutii/marceland | Cod sursa (job #339931) | Cod sursa (job #798869)
Cod sursa(job #798869)
#include<fstream>
using namespace std;
int main(){
ifstream fin("fact.in");
ofstream fout("fact.out");
long long p, s, i;
fin >> p;
if(p == 0) s = 1;
else if((p-5)%6 == 0) s = -1;
else {
i = p - p/6;
s = i*5;
}
fout << s;
fin.close();
fout.close();
return 0;
}