Cod sursa(job #2376203)

Utilizator Alexandru19Alexandru Gheorghiu Alexandru19 Data 8 martie 2019 14:07:39
Problema Factorial Scor 10
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.42 kb
#include <fstream>

using namespace std;
ifstream cin("fact.in");
ofstream cout("fact.out");

int r(int t){
int i,s=0;
for(i=1; i<=t; i++)
    {
        s=s+5;
        if(s%25==0){t--;}
    }
return s;
}



int main()
{
    long long n,p,k=0,j,a,i,s=0;
    cin>>n;
    a=n;
    a++;
if (n==0)cout<<1;
else {
    s=r(n);
    k=r(a);
    if(k==s){cout<<-1;}
    else {cout<<s;}
}
    return 0;
}