fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int t;
  6. cin >> t;
  7. while(t--)
  8. {
  9. int n,x;
  10. cin >> n >> x;
  11. for(int i=0;i<x;i++)
  12. {
  13. cout << i << " " ;
  14. }
  15. for(int i=n-1;i>=x;i--)
  16. {
  17. cout << i << " ";
  18. }
  19. cout << endl;
  20. }
  21. return 0;
  22. }
Success #stdin #stdout 0.01s 5296KB
stdin
7
4 2
4 0
5 0
1 1
3 3
1 0
4 3
stdout
0 1 3 2 
3 2 1 0 
4 3 2 1 0 
0 
0 1 2 
0 
0 1 2 3