#include <iostream>

using namespace std;

int main(){
	int t;
	cin>>t;
	
	long long int ans[t];
	
	int n,c;
	long long int mini[2],sumi[2];
	for(int i=0;i<t;i++){
		cin>>n;
		cin>>mini[0];
		cin>>mini[1];
		ans[i]=n*(mini[0]+mini[1]);
		sumi[0]=mini[0];
		sumi[1]=mini[1];
		for(int j=2;j<n;j++){
			cin>>c;
			mini[j%2]=(c<mini[j%2])?c:mini[j%2];
			sumi[j%2]+=c;
			if(sumi[j%2]-mini[j%2]+sumi[(j+1)%2]-mini[(j+1)%2]+(n-j/2)*mini[j%2]+(n-(j-1)/2)*mini[(j+1)%2]<ans[i])
			ans[i]=sumi[j%2]-mini[j%2]+sumi[(j+1)%2]-mini[(j+1)%2]+(n-j/2)*mini[j%2]+(n-(j-1)/2)*mini[(j+1)%2];
		}
	}
	
	for(int i=0;i<t;i++){
		cout<<ans[i]<<endl;
	}
	return 0;
}
