#include<bits/stdc++.h>

using namespace std;

#define int long long
#define se second
#define fi first

signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int t;
    cin >> t;
    while (t--) {
        int n;
        cin >> n;
        vector<int> s(n);
        for (int i = 0; i < n; ++i) {
            cin >> s[i];
        }
        vector<int> rem = {n, n};
        vector<int> mn = {(int)1e9, (int)1e9};
        int cur = 0, res = 1e18;
        for (int i = 0; i < n; ++i) {
            mn[i % 2] = min(mn[i % 2], s[i]);
            rem[i % 2] -= 1;
            cur += s[i];
            res = min(res, cur + mn[0] * rem[0] + mn[1] * rem[1]);
        }
        cout << res << "\n";
    }
}
