#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using PQ = priority_queue<ll>;
using PQG = priority_queue<ll, vector<ll>, greater<ll>>;
using PQP = priority_queue<P>;
using PQPG = priority_queue<P, vector<P>, greater<P>>;
template <class T>
using V = vector<T>;
template <class T>
using VV = V<V<T>>;

#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=ll(a);i<=ll(b);i++)
#define FORD(i,a,b) for(ll i=ll(a);i>=ll(b);i--)
#define PB push_back
#define MP make_pair
#define SZ(x) ll(x.size())
#define ALL(x) x.begin(),x.end()
#define NIL -1
#define INF 1000100010001000
#define CINF 1ll<<63-1
#define MOD 1000000007
#define PI 3.14159265358979323846
#define endl "\n"
#define EPS 1e-9

template <class T, class U>
bool chmin(T& t, const U& u) {
    if (t > u) {
        t = u;
        return true;
    }
    else return false;
}

template <class T, class U>
bool chmax(T& t, const U& u) {
    if (t < u) {
        t = u;
        return true;
    }
    else return false;
}

class UnionFind {
public:
    vector<ll> parent;
    vector<ll> siz;
    map<ll, vector<ll> > group;
    ll n;

    UnionFind(ll n_) :n(n_), parent(n_), siz(n_, 1) {
        for (ll i = 0; i < n; i++) { parent[i] = i; }
    }

    ll root(ll x) {
        if (parent[x] == x) return x;
        return parent[x] = root(parent[x]);
    }

    bool unite(ll x, ll y) {
        ll rx = root(x);
        ll ry = root(y);
        if (rx == ry) return false;
        if (siz[rx] < siz[ry]) swap(rx, ry);
        siz[rx] += siz[ry];
        parent[ry] = rx;
        return true;
    }

    bool same(ll x, ll y) {
        return root(x) == root(y);
    }

    ll size(ll x) {
        return siz[root(x)];
    }
};

signed main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);

    ll t; cin >> t;
    while (t) {
        ll n; cin >> n;
        V<ll> a(n);
        REP(i, n)cin >> a[i];
        ll mih = a[0], miv = a[1];
        ll ch = 1, cv = 1;
        ll k = mih * n + miv * n;
        ll ans = k;
        FOR(i, 2, n - 1) {
            if (i % 2 == 0) {
                ch++;
                ans += a[i];
                ans -= (n + 1 - ch) * mih;
                chmin(mih, a[i]);
                ans += (n - ch) * mih;   
            }
            else {
                cv++;
                ans += a[i];
                ans -= (n + 1 - cv) * miv;
                chmin(miv, a[i]);
                ans += (n - cv) * miv;
            }
            chmin(k, ans);
        }

        cout << k << endl;


        t--;
    }
}

