#include <bits/stdc++.h>
#define fir first
#define sec second
using namespace std;
 
typedef long long ll;
typedef pair<int,int> P;
typedef pair<P,P> Q;
 
const int inf1 = 1e9+9;
const ll inf2 = 1e16+9;
const int mod = 1e9+7;
const int maxx = 1e7+9;
const int maxn = 1e5+9;

int n,ar[maxn];

int main()
{
    int T;
    scanf("%d",&T);
    while(T--) {
        scanf("%d",&n);
        for(int i=1;i<=n;i++) scanf("%d",&ar[i]);
        ll mip[2]={1,2},cnt[2]={n,n};
        ll sum=0,ans=1ll*cnt[0]*ar[mip[0]]+1ll*cnt[1]*ar[mip[1]];
        for(int i=3;i<=n;i++) {
            cnt[(i-1)&1]--;
            if(ar[i]<=ar[mip[(i-1)&1]]) sum+=ar[mip[(i-1)&1]],mip[(i-1)&1]=i;
            else sum+=ar[i];
            ans=min(ans,sum+1ll*cnt[0]*ar[mip[0]]+1ll*cnt[1]*ar[mip[1]]);
        }
        printf("%lld\n",ans);
    }
    return 0;
}