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

template<typename T>
void out(T x) { cout << x << endl; exit(0); }

const ll maxval = 1e18 + 7;

ll solve() {
    ll n; cin >> n;
    vector<ll> v(n);
    for (int i = 0; i < n; i++) {
        cin >> v[i];
    }

    vector<ll> minn(n,maxval);

    for (int i = 0; i < n; i++) {
        minn[i] = v[i];
        if (i-2 >= 0) {
            minn[i] = min(minn[i], minn[i-2]);
        }
    }

    ll ans = maxval;

    vector<ll> tot(2,0ll);
    vector<ll> cnt(2,0ll);

    for (int i = 0; i < n; i++) {
        tot[(i%2)] += v[i];
        cnt[(i%2)]++;

        if (i-1 < 0) continue;
        
        ll temp = 0ll;

        {
            ll mod1 = (i%2);
            ll stepsmin1 = n - (cnt[mod1]-1);
            ll val1 = minn[i] * stepsmin1;
            val1 += tot[mod1] - minn[i];
            // cout << "val1 = " << val1 << "\n";
            temp += val1;
        }

        {
            ll modp = (i-1)%2;
            ll valp = minn[i-1] * (n - (cnt[modp]-1));
            valp += tot[modp] - minn[i-1];
            // cout << "valp = " << valp << "\n";
            temp += valp;
        }

        ans = min(ans,temp);
    }

    assert(ans < maxval);
    return ans;
}

int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);

    int T; cin >> T;
    while (T--) {
        cout << solve() << "\n";
    }
    
    return 0;
}
