Ankit_132

B

Dec 19th, 2023
427
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1.  
  2. #include <bits/stdc++.h>
  3. using namespace std;
  4.  
  5. #define _test   int _TEST; cin>>_TEST; while(_TEST--)
  6. #define pb     push_back
  7.  
  8. int main()
  9. {
  10.     _test
  11.     {
  12.         int n, k;
  13.         cin>>n>>k;
  14.  
  15.         vector<int> ans;
  16.  
  17.         for(int i=1; i<=k; i++)
  18.             ans.pb(i);
  19.  
  20.         for(int i=n; i>k; i--)
  21.             ans.pb(i);
  22.  
  23.         for(auto &e: ans)       cout<<e<<" ";
  24.         cout<<"\n";
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment