/*
    Username : moondancer
    Name : Moon Dancer
*/


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

#define int long long

signed main(){
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int t;
    cin >> t;
    while(t--) {
        int n;
        cin >> n;
        int a[n];
        for (int i = 0; i < n; ++i) {
            cin >> a[i];
        }
        int cur = 0;
        int ans = 2e18;
        int now = n-1;
        int even = n, odd = n;
        int evenmin = a[0] + 1, oddmin = a[1] + 1;
        int evensum = 0, oddsum = 0;
        for (int i = 0; i < n; ++i) {
            if(i%2 == 0) {
                evensum += a[i];
                evenmin = min(evenmin, a[i]);
                even--;
                if(i)
                    ans = min(ans, evensum + evenmin*even + oddsum + oddmin*odd);
            }
            else {
                oddsum += a[i];
                oddmin = min(oddmin, a[i]);
                odd--;
                ans = min(ans, evensum + evenmin*even + oddsum + oddmin*odd);
            }
            // if(i) {
            //     cur += a[i-1];
            //     if((i-1)%2) {
            //         odd--;
            //     }
            //     else {
            //         even--;
            //     }
            // }
            // int now = cur;
            // if(i%2) {
            //     now += odd*a[i];
            //     now += even*a[i+1];
            // }
            // else {
            //     now += even*a[i];
            //     now += odd*a[i+1];
            // }
            // ans = min(ans, now);
        }
        cout << ans << "\n";
    }
    return 0;
}