#include<bits/stdc++.h>
using namespace std; 
#define int long long
#define PII pair<int,int>
#define INF 0x3f3f3f3f
const int N=1e6+5;
int k,t,n,m,ans;
int a[N],s[N];
bool vis[N];
signed main()
{
	ios::sync_with_stdio(false);
 	cin.tie(0);
	cin>>t;
	while(t--)
	{
		cin>>n;
		memset(s,0,sizeof s);
		for(int i=1;i<=n;i++)
		{
			cin>>a[i];			
			s[i]=s[i-1]+a[i];
		}
		int minn=1e15,sum=0;	
		int mx=a[1],my=a[2];	
		for(int i=2;i<=n;i++)
		{
			sum=s[i];			
			if(i%2==0)
			{
				my=min(my,a[i]);
				sum+=mx*(n-i/2);
				sum+=my*(n-i/2);
			}
			else
			{
				mx=min(mx,a[i]);
				sum+=mx*(n-i/2-1);
				sum+=my*(n-i/2);
			}
			minn=min(minn,sum);											
		}
		cout<<minn<<endl;
	}
	return 0;
}
