Presents for Cheffina Solution || Codechef Starters - 36

      

Presents for Cheffina Solution 

Codechef Starters - 36
Problem Code : PRESENTS

Solution :

#include <bits/stdc++.h>
#define ll long long int
using namespace std;

int main()
{
    ll t = 1;
    cin >> t;
    while (t--)
    {
        ll n;
        cin >> n;
        if (n % 5 == 0)
        {
            cout << (n / 5) * 4;
        }
        else
        {
            cout << ((n / 5) * 4) + (n % 5);
        }
        cout << "\n";
    }
}

Comments