#include <bits/stdc++.h>
#include "partition.h"

using namespace std;

int n;

std::vector<int> solve(std::vector<int> A) {
    n = A.size();

    vector<int> p1;
    vector<int> p2;
    for (int i = 0; i < n / 2; ++i) {
        if (i % 2 == 0) {
            p1.push_back(i);
            p1.push_back(n - i - 1);
        }

        if (i % 2 == 1) {
            p2.push_back(i);
            p2.push_back(n - i - 1);
        }
    }

    if (n % 2 == 1)
        p1.push_back((n + 1) / 2);

    vector<int> ans;
    for (auto &pos : p1)
        ans.push_back(pos);

    for (auto &pos : p2)
        ans.push_back(pos);

    return ans;
}

#ifndef EVAL
#include<iostream>
#include<vector>
using namespace std;
extern vector<int> solve(vector<int> A);
int main () {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    cin >> t ;
    for (int test=1; test<=t; test++) {
        int n;
        cin >> n ;
        vector <int> a(n);
        for (int i=0; i<n; i++) {
            cin >> a[i] ;
        }

        for (auto ind : solve(a)) {
            cout << ind << " ";
        }
        cout << endl ;
    }
    cout << endl ;
    return 0;
}
#endif