#include<iostream>
#include<fstream>
using namespace std;
int main()
{
int p,t;
ifstream f("fact.in");
ofstream g("fact.out");
f>>p;
t=p/5;
if(p%6==5)
g<<-1;
else
{
if(p==0)
g<<1;
else
{
if(p%5!=0)
g<<(p-t)*5;
else g<<(p-t+1)*5;
}
}
return 0;
}
Imi poate spunce cineva de ce iau doar 15 puncte?
