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

using ll = long long;
using pii = pair<int, int>;

// 💖 Hi, thanks for using ICIE! 💖
// 🔧 To use a custom code template, press Ctrl+Shift+P and select "ICIE Template configure" from the list 🔧
// 📝 If you spot any bugs or miss any features, create an issue at https://github.com/pustaczek/icie/issues 📝

const int maxn = 1e5;

ll c[maxn];
ll c1[maxn], c2[maxn];

void solve()
{
    int n;
    cin >> n;

    for (int i = 0; i < n; ++i)
    {
        cin >> c[i];
    }

    ll sum = 0;
    ll minn = LLONG_MAX;
    for (int i = 0; i * 2 < n; ++i)
    {
        c1[i] = sum + (n - i) * c[i << 1];
        if (i > 0) {
            c1[i] = min(c1[i], c1[i - 1] - minn + c[i << 1]);
        }
        // cout << c1[i] << endl;
        sum += c[i << 1];
        minn = min(c[i << 1], minn);
    }

    sum = 0;
    minn = LLONG_MAX;
    for (int i = 0; i * 2 + 1 < n; ++i)
    {
        c2[i] = sum + (n - i) * c[(i << 1) + 1];
        if (i > 0)
        {
            c2[i] = min(c2[i], c2[i - 1] - minn + c[(i << 1) + 1]);
        }
        sum += c[(i << 1) + 1];
        minn = min(minn, c[(i << 1) + 1]);
    }
    ll ans = LLONG_MAX;
    for (int i = 0; i * 2 < n; ++i)
    {
        if (i * 2 + 1 < n)
        {
            ans = min(ans, c1[i] + c2[i]);
        }
        if (i > 0)
        {
            ans = min(ans, c1[i] + c2[i - 1]);
        }
    }

    cout << ans << endl;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int t;
    cin >> t;
    while (t--)
    {
        solve();
    }
}
