682A Codeforces - Alyona and numbers


682A Codeforces - Alyona and numbers




Solution in C++


#include <iostream>

using namespace std;

long long  n,m,sol;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    cin>>n>>m;
    int o,t2,t3,f4,f5;
    for(int i=1;i<=5;i++)
    {
        long long ele=0;
        ele+=(m/10)*2;
        if(m%10>=5-(i%5) )ele++;
        if(m%10>=10-(i%5) )ele++;
        sol+=ele *(n/5+ (( n%5>=i )?1:0)  );
    }
    cout<<sol;
    return 0;
}
Share on Google Plus

About Mohamed Sobhi

My name is Mo.Sobhy ,I study at School excelling high school in Ain Shams ,Cairo
My hobbies is programming ,and web development ,playing chess and writing horror stories.
    Blogger Comment
    Facebook Comment

0 التعليقات:

إرسال تعليق