// Smit Vavliya

#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define mod 1000000007
const int inf = (1LL<<60) - 1;
struct pair_hash { template <class T1, class T2> std::size_t operator()(const std::pair<T1, T2> &p) const {
        auto h1 = std::hash<T1>{}(p.first);
        auto h2 = std::hash<T2>{}(p.second);
        return h1 ^ h2;
    }
};

const int N = 2e5 + 5;
vector<int> graph[N];
vector<bool> visited(N);
int n, arr[N], b[N];

int32_t main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int T;
    cin >> T;
    while(T--) {
        cin >> n;
        for(int i = 1; i <= n; i++) cin >> arr[i];
        priority_queue<int, vector<int>, greater<int>> odd, even;
        odd.push(arr[1]);
        int prevOdd = arr[1], prevEven = 0;
        int ans = inf;
        for(int i = 2; i <= n; i++) {
            int r;
            if(i % 2) {
                int d = even.top();
                r = prevEven - d + d * (n - even.size() + 1);
                odd.push(arr[i]);
                prevOdd += arr[i];
                d = odd.top();
                r += prevOdd - d + d * (n - odd.size() + 1);
            } else {
                int d = odd.top();
                r = prevOdd - d + d * (n - odd.size() + 1);
                even.push(arr[i]);
                prevEven += arr[i];
                d = even.top();
                r += prevEven - d + d * (n - even.size() + 1);
            }

            ans = min(ans, r);
        }
        cout << ans << endl;
    }   
}
