617A - Elephant Codeforces || Codeforces 617A - Elephant Solution

Problem Name: Elephant

Problem Code: 617A

Judge: Codeforces

Problem link: Elephant




Codeforces 617A - Elephant Solution in C++/Cpp

#include <iostream>

using namespace std;

int main()
{
    int n, count = 0;
    cin >> n;
    if (n <= 5)
    {
        cout << 1 << endl;
    }
    else
    {
        int value = 5;
        int temp = n;
        while (n != 0)
        {
            temp = temp / value;
            value = value - 1;
            count = count + n;
            int x = n - temp;
            if (x <= 5)
            {
                count = count + 1;
                cout << count << endl;
                break;
            } else
            {

            }
        }
    }

    return 0;
}





 











Codeforces 617A - Elephant solution in C C++, 617A codeforces solution in C C++, Codeforces 617A solution in C C++, Codeforces Elephant solution in C C++, 617A - Elephant Codeforces solution in C C++, Codeforces 617A - Elephant solution in C C++, codeforces solutions, online judge solutions, online problem solutions, Codeforces, CF 


Next Post Previous Post
No Comment
Add Comment
comment url