#include<bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
using namespace std;
// typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define ll long long 
#define scn(n) scanf("%d",&n)
#define lscn(n) scanf("%lld",&n)
#define lpri(n) printf("%lld",n)
#define pri(n) printf("%d",n)
#define pln() printf("\n")
#define priln(n) printf("%d\n",n)
#define lpriln(n) printf("%lld\n",n)
#define rep(i,init,n) for(int i=init;i<n;i++)
#define pb push_back     
#define mp make_pair
#define F first
#define S second
#define gcd __gcd
#define inf INT_MAX
#define ninf INT_MIN   
#define inf INT_MAX
#define linf LLONG_MAX
#define lninf LLONG_MIN   
const int mod = 1e9 + 7;
const int N = 1e6 + 4;

int solve()
{
	int n; scn(n);

	ll a[n]; rep(i, 0, n) lscn(a[i]);

	vector<ll> pa(n, 0), psum(n, 0);

	pa[0] = psum[0] = a[0]; pa[1] = a[1];

	rep(i, 1, n)
	psum[i] = a[i] + psum[i - 1];

	rep(i, 2, n)
	{
		pa[i] = a[i];

		pa[i] = min(pa[i], pa[i - 2]);
	}

	ll ans = LLONG_MAX;

	rep(i, 1, n)
	{
		ll x, y;

		if(i % 2 == 0)
		x = (i / 2) + 1, y = (i / 2);
		else
		x = y = (i + 1) / 2;

		ll xx = n - x, yy = n - y;

		// if(xx < yy)
		// swap(xx, yy);

		ll cx = pa[i], cy = pa[i - 1];

		// if(cx > cy)
		// swap(cx, cy);

		ll here = psum[i];

		here += cx * xx; here += cy * yy;

		// cout << i << " " << here << " " << xx << " " << yy << endl;

		ans = min(ans, here);
	}

	lpriln(ans);

	return 0;
}

int main()                  
{
	int t = 1; scn(t);

	while(t--)
	{
		solve();
	}

    return 0;
}