// Problem: C. Minimum Grid Path
// Contest: Codeforces - Educational Codeforces Round 106 (Rated for Div. 2)
// URL: https://codeforces.com/contest/1499/problem/C
// Memory Limit: 256 MB
// Time Limit: 2000 ms
//
// Powered by CP Editor (https://cpeditor.org)

#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ld long double
#define pll pair<ll, ll>
#define X first
#define Y second
#define pb emplace_back
#define nl "\n"
#define vl vector<ll>
#define mod 1000000007

ll dx[] = {0, 1, 0, -1, 0};

ll min(ll a, ll b) { return a < b ? a : b; }
ll max(ll a, ll b) { return a > b ? a : b; }
ll power(ll a, ll b, ll m) {
  a %= m;
  ll r = 1;
  while (b > 0) {
    if (b & 1) r = r * a % m;
    a = a * a % m;
    b >>= 1;
  }
  return r;
}

void solve() {
  // code...
  ll n;
  cin >> n;
  vl c(n);
  for (ll i = 0; i < n; i++) {
    cin >> c[i];
  }
  ll usum = c[0], rsum = c[1];
  ll umin = c[0], rmin = c[1];
  ll uprev = n * c[0], rprev = n * c[1];
  ll res = uprev + rprev;
  for (ll i = 2; i < n; i++) {
    if (i % 2 == 0) {
      usum += c[i];
      umin = min(umin, c[i]);
      uprev = usum + (n - i / 2 - 1) * umin;
    } else {
      rsum += c[i];
      rmin = min(rmin, c[i]);
      rprev = rsum + (n - i / 2 - 1) * rmin;
    }
    res = min(res, uprev + rprev);
  }
  cout << res << nl;
  return;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
