Cod sursa(job #2376170)

Utilizator Alexandru19Alexandru Gheorghiu Alexandru19 Data 8 martie 2019 13:56:02
Problema Factorial Scor 5
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.42 kb
#include <fstream>
using namespace std;
ifstream in("fact.in");
ofstream out("fact.out");
bool v[100005];
int main()
{
    long long n,p,k=0,a,i,s=0;
    in>>n;
    a=n;

    for(i=1; i<=n; i++)
    {
        s=s+5;
        if(s%25==0){n--;}
    }
    n=a;
    n++;
    for(i=1; i<=n; i++)
    {
        k=k+5;
        if(k%25==0){n--;}
    }
    if(k==s){out<<-1;}
    else {out<<s;}

    return 0;
}