Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- int t;
- cin >> t;
- while(t--){
- int n;
- cin>>n;
- if(n % 2 == 0){
- for(int i = 1; i <=n/2; i++)
- cout << i << " " << n-i+1 << " ";
- }else{
- for(int i = 1; i <=n/2; i++)
- cout << i << " " << n-i << " ";
- cout << n;
- }
- cout << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment