#include<bits/stdc++.h>
#include<vector>
#include<map>
#include<queue>
#define LL long long
#define INF INT64_MAX
#define MOD 1000000007
#define stree SegTree[root]
#define lson SegTree[root << 1]
#define rson SegTree[root << 1 | 1]
using namespace std;
const int N = 100005;
LL a[N];
int main()
{
    int t, n;
    cin>>t;
    LL Min = INF;
    int tt = 0;
    while(t--)
    {
        tt++;
        cin>>n;
        for(int i = 1;i <= n;i++)
        {
            cin>>a[i];
        }
        LL ans = INF, tem = 0, m1 = INT_MAX, m2 = INT_MAX;
        for(int i = 1;i <= n;i++)
        {
            if(i&1)
            {
                m1 = min(m1, a[i]);
                ans = min(ans, tem + m1*(n-i/2) + m2*(n-i/2));
                tem += a[i];
                //printf("1ans = %lld tem = %lld\n", ans, tem);
            }
            else
            {
                m2 = min(m2, a[i]);
                ans = min(ans, tem + m2*(n-(i-1)/2) + m1*(n-i/2));
                tem += a[i];
                //printf("2ans = %lld tem = %lld\n", ans, tem);
            }
        }
        printf("%lld\n", ans);
    }
    return 0;
}
