My issue
even by copying the code given in the solution page returns failed testcase.
My code
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
ll t;
cin >> t;
while (t--)
{
ll n, k;
cin >> n >> k;
if(k==n)
{
for(int i=1;i<=n;i++)
{
cout<<i<<" ";
}
cout<<endl;
}
else if (k==n-1)
{
cout << -1 << endl;
}
else
{
for(int i=1;i<=k;i++)
{
cout<<i<<" ";
}
for(int i=k+2;i<=n;i++)
{
cout<<i<<" ";
}
cout<<k+1<<endl;
}
}
return 0;
}
Learning course: Medium C++ puzzles
Problem Link: FIXFIX Practice Problem in - CodeChef