fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here(
  6. int T;
  7. cin>>T;
  8. for(int t=0;t<T;t++)
  9. {
  10. int n;
  11. cin>>n;
  12. int nn=4*n;;
  13. for(int i=0;i<n;i++)
  14. {
  15. if(i%2==0)
  16. {cout<<nn-2<<" ";nn=nn-2;}
  17. else
  18. {cout<<nn-4<<" ";nn=nn-4;}
  19. }
  20. cout<<endl;
  21. }
  22. return 0;
  23. }
Success #stdin #stdout 0s 4940KB
stdin
3
2
3
4
stdout
6 2 
10 6 4 
14 10 8 4