My issue
please give me intution for it
My code
#include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
}
Problem Link: Split Permutation Practice Coding Problem
please give me intution for it
#include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
}
Problem Link: Split Permutation Practice Coding Problem
@rishabh_129567
plzz refer the following code for better understanding
#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)
{
for(int i=1,j=n;i<j;i++,j--)
cout<<i<<" "<<j<<" ";
}
else
{
cout<<n<<" ";
n=n-1;
for(int i=1,j=n;i<j;i++,j--)
cout<<i<<" "<<j<<" ";
}
cout<<endl;
}
}