Akash and Missing Class Solution
Codechef March Long Challenge 2022 - I
Problem Code : CHFCLASS
Solution :
#include <bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
using namespace std;
void solve()
{
ll n;
cin >> n;
if (n % 7 == 6)
{
cout << (n / 7) + 1 << "\n";
}
else
{
cout << n / 7 << "\n";
}
}
int main()
{
ll t;
cin >> t;
while (t--)
{
solve();
}
}
Comments
Post a Comment