#include <bits/stdc++.h>
using namespace std;
#define ll long long

std::vector<int> solve(std::vector<int> A){
    int N = A.size();
    if(N == 1)return {0};
    vector<int> ans;
    if(N % 2 == 0){
        for(int i = 0; i < N / 2; i+=2){
            ans.push_back(i);
            ans.push_back(N - i - 1);
        }
        for(int i = 1; i <= N / 2; i+=2){
            ans.push_back(i);
            ans.push_back(N-i-1);
        }
    }else{
        ans.push_back(0);
        ans.push_back(N - 2);
        for(int i = 1; i < N / 2; i+=2){
            ans.push_back(i);
            ans.push_back(N - i - 2);
        }
        for(int i = 2; i <= N / 2; i+=2){
            ans.push_back(i);
            ans.push_back(N-i-2);
        }
        ans.push_back(N-1);
    }
    return ans;
}
/*int main(){
    int t;
    cin >> t;
    while(t--){
        int n;
        cin >> n;
        vector<int> a(n);
        for(int i = 0; i < n; i++){
            cin >> a[i];
        }
        vector<int> ANS = solve(a);
        for(int i = 0; i < n; i++){
            cout << ANS[i] << " ";
        }
        cout << "\n";
    }
}*/
