since i want the sum to be odd it can be possible when two number is odd and even.
so i will take two number from the [1 N] and placed in the new vector and decrease k–
include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin>>t;
while(t–){
int n,k;
cin>>n>>k;
vectorv(n+1,false);
v[0]=true;
vectorresult;
while(k){
for(int i=1;i<v.size();i++){
if(v[i]==false and (result.empty()||i%2==1)){
result.push_back(i);
v[i]=true;
break;
}
if(v[i]==false and i%2==0){
result.push_back(i);
v[i]=true;
k--;
break;
}
}
}
for(int i=0;i<v.size();i++){
if(v[i]==false){
result.push_back(i);
}
}
for(int i=0;i<v.size();i++){
cout<<v[i]<<" ";
}
}
}
// but i am not getting correct output plz help me