#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define FOR(i,x,n) for(int i = x; i<=n; i++)
#define FORO(i,n) for(int i = 0; i<n; i++)
#define nl "\n"
#define sp " "
#define MOD 1000000007
#define pb push_back

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int t;
	cin>>t;
	while(t--){
		int n;
		cin>>n;
		ll a[n];
		vector<ll> gnj, gnp, pref1, pref2;
		FORO(i,n){
			cin>>a[i];
			if(i%2==0){
				gnp.pb(a[i]);
				if(i==0) pref1.pb(a[i]);
				else pref1.pb(pref1[pref1.size()-1]+a[i]);
			}
			else{
				gnj.pb(a[i]);
				if(i==1) pref2.pb(a[i]);
				else pref2.pb(pref2[pref2.size()-1]+a[i]);
			}
		}
		ll min1 = 0, min2 = 0, mini, prev, id1 = 0, id2 = 0;
		FORO(i,gnp.size()){
			if(i==0){
				min1 = gnp[i];
				min2 = gnj[i];
				mini = min1*n+min2*n;
				prev = min2*n;
			}
			else{
				if(gnp[i]<min1) min1 = gnp[i], id1 = i;
				if(gnj[i]<min2) min2 = gnj[i], id2 = i;
				ll temp;
				if(gnj.size()<gnp.size()&&i==gnp.size()-1) temp = prev;
				else temp = min(prev, min2*(n-i)+pref2[i]-gnj[id2]);
				mini = min(mini, min1*(n-i)+pref1[i]-gnp[id1]+temp);
				prev = min2*(n-i)+pref2[i]-gnj[id2];
			}
			//cout<<mini<<nl;
		}
		cout<<mini<<nl;
	}
	return 0;
}
