My issue
how I solvethis question can you explIN ME
My code
t=int
Problem Link: The Man Code Practice Coding Problem - CodeChef
how I solvethis question can you explIN ME
t=int
Problem Link: The Man Code Practice Coding Problem - CodeChef
@shreyaverma22
the logic is to get max just place at the alternate positions .
but to get the minimum just place one(in the middle) at every set of 3 consecutives.
plzz refer my code
#include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
if(n%2==0)
{
cout<<n/2<<" "<<ceil(n*1.0/3*1.0);
}
else
{
cout<<(n+1)/2<<" "<<ceil(n*1.0/3*1.0);
}
cout<<endl;
}
}