#include<bits/stdc++.h>
using namespace std;
int main()
{
  int t,n;
  cin >> t;
  while(t--)
  {
  cin >> n;
  long long arr[n],n1,n2;
  for(int i=0;i < n;i++)
   cin >> arr[i];
  
  if(n % 2 == 0)
  {
  	n1=n/2;n2=n/2;
  }
  else
  {
  	n2=n/2;
  	n1=n-n2;
  }
  long long dp1[n1],dp2[n2];
  long long sum=0,minn=LLONG_MAX;
  for(int i=0,k=0;i < n;i+=2,k++)
  {

  	minn = min(minn,arr[i]);

  	sum += arr[i];
  	dp1[k] = minn * (n - k) + sum - minn;
  	//cout << minn << " "<< dp1[k] << endl;
  }
  sum=0;minn=LLONG_MAX;
  for(int i=1,k=0;i < n;i+=2,k++)
  {
  	minn = min(minn,arr[i]);
  	sum += arr[i];
  	dp2[k] = minn * (n - k) + sum - minn;
  	//cout << minn << " "<< dp2[k] << endl;
  }
  long long ans=LLONG_MAX;
   ans = min(ans,dp1[0]+dp2[0]);
  for(int i=1;i < n1;i++)
  {
     ans = min(ans,dp1[i]+dp2[i]);
     ans = min(ans,dp1[i]+dp2[i-1]);
     //ans= min(ans,dp1[i-1]+dp2[i]);
  }
    //cout << ans << endl;

  if(n2 > n1)
  {
   ans =  min(ans , dp2[n2-1]+dp1[n1-1]);
  }
  cout << ans << endl;

  } 

  return 0;
}