#include <bits/stdc++.h>

using namespace std;
#define IO ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef long long ll;

const int N = 2e5+5;
ll n, t, ans, me, mo, x, y;
string s;

int main()
{
    IO;
    cin >> t;
    while(t--){
        y = 0, me = 2e9, mo = 2e9, ans = 1e15;
        cin >> n;
        for(int i = 0; i < n; ++i){
            cin >> x;
            y += x;
            if(i&1) mo = min(mo, x);
            else me = min(me, x);
            if(i){
                ans = min(ans, y + (n-i/2-1)*me +(n-(i+1)/2)*mo);
            }
        }
        cout << ans << endl;
    }
}
