#include<bits/stdc++.h>
using namespace std;
#define ll               long long
#define pb                push_back
#define ppb               pop_back
#define pf                push_front
#define ppf               pop_front
#define all(x)            (x).begin(),(x).end()
#define uniq(v)           (v).erase(unique(all(v)),(v).end())
#define sz(x)             (int)((x).size())
#define fr                 first
#define sc                second
#define pii                pair<int,int>
#define rep(i,a,b)        for(int i=a;i<b;i++)
#define mem1(a)           memset(a,-1,sizeof(a))
#define mem0(a)           memset(a,0,sizeof(a))
#define fl fflush(stdout)
//#define mod 1000000007
#define mod2 998244353
#define pi 3.14159265358979323846
//bool comp(const pair<int,double> &a,const pair<int,double> &b){  return (a.second > b.second);  }
/*
bool prime[111111];+
bool isPrime(int n)
{
    for(int i=2;i*i<=n;++i)
    {
        if(n%i==0)
            return false;
    }
    return true;
}
int prime[10000005];
void sieve(int n)
{
    for(int i=1;i<=10000000;i++)prime[i]=i;
    for (int p=2;p*p<=n;p++)
    {
        if (prime[p]==p)
        {
            for (int i=p*p;i<=n;i+=p)prime[i]=p;
        }
    }
}
void dfs(int p){
	used[p]=true;
	rep(i,n){
		if(used[i]==true) continue;
		if(X[i]==X[p] || Y[i]==Y[p])dfs(i);
	}
}
void update(int x, ll val){while(x <= n)tree[x] += val,x += (x & -x);}
ll read(int x){ ll sum=0; while (x>0)sum+=tree[x],x -= (x & -x); return sum;}
void update(int l, int r, int nod, int lvl)
{
	  if(l==r)tree[nod] = x;
      else
		{
			int mid = (l+r)/2; //left tree
			if(i <= mid) update(l,mid,nod*2,lvl-1);//right tree
			else update(mid+1,r,nod*2+1,lvl-1);
			if(lvl%2 == 0) tree[nod] = (tree[2*nod]^tree[nod*2 + 1]);
			else tree[nod] = (tree[2*nod]|tree[nod*2 + 1]);
		}
}
bool sortbysec(const pair<int,int> &a , const pair<int,int> &b) {
    if(a.first==b.first) {return(a.second < b.second);}
    else return a.first<b.first;
    }*/
void solve(){
     int n; cin>>n;
     vector<ll> v(n),mn(n+8);
     rep(i,0,n)cin>>v[i];
      ll ans = 1e18,sum = 0;
      rep(i,0,n){
			sum += v[i]; mn[i] = v[i];
			if (i>=2)mn[i] = min(mn[i - 2], v[i]);
		}
		ll s1=n/2,s2=(n+1)/2;
		for (ll i=n-1;i>=1;i--) {
			ans = min(ans,sum+mn[i] *s1+mn[i - 1]*s2);
			sum -= v[i];
			if (i%2) s2++;
			else s1++;
		}
		cout<<ans<<endl;
}
int main(){
   // ios_base::sync_with_stdio(false);
	//cin.tie(0);cout.tie(0);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	 //sieve(10000000);
    int t; cin>>t; while(t--)
    solve();
}
