#include <iostream>
#include <fstream>

#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_set>
#include <unordered_map>
#include <vector>

#define ll long long
using namespace std;

static bool MULTIPLE_CASES = true;
static long long MOD = (long long) 1e9 + 7;
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

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

    ll minRight = c[0];
    ll minUp = c[1];
    ll sumRight = minRight;
    ll sumUp = minUp;
    ll ups = 1;
    ll rights = 1;
    ll best = LONG_LONG_MAX;
    for (int lastSegment = 1; lastSegment < n; lastSegment++) {
        if (lastSegment > 1) {
            bool right = lastSegment % 2 == 0;
            if (right) {
                sumRight += c[lastSegment];
                minRight = min(minRight, c[lastSegment]);
                rights++;
            } else {
                sumUp += c[lastSegment];
                minUp = min(minUp, c[lastSegment]);
                ups++;
            }
        }
        ll cost = sumUp + sumRight + (n - ups) * minUp + (n - rights) * minRight;
        best = min(best, cost);
    }
    cout << best << '\n';
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    if (MULTIPLE_CASES) {
        int tests;
        cin >> tests;
        while (tests--) solve();
    } else {
        solve();
    }
}
