#include <bits/stdc++.h>

#define ll long long

using namespace std;

const int mxN = 1e6 + 5, mod = 1e9 + 7;
const ll inf = 1e18;

ll costA[mxN], costB[mxN], pref[mxN], c[mxN];

int main() {
	ios :: sync_with_stdio(false), cin.tie(nullptr);
	int t;
	cin >> t;
	while (t--) {
		int n;
		cin >> n;
		costA[0] = inf, costB[0] = inf;
		for (int i = 1; i <= n; ++i) {
			cin >> c[i];
			costA[i] = costB[i] = inf;
		}
		ll mn = inf, sum = 0;
		for (int i = 1, j = 1; i <= n; i += 2, ++j) {
			mn = min(mn, c[i]);
			sum += c[i];
			costA[j] = (n - j + 1) * 1ll * mn + (sum - mn);
		}
		mn = inf, sum = 0;
		for (int i = 2, j = 1; i <= n; i += 2, ++j) {
			mn = min(mn, c[i]);
			sum += c[i];
			costB[j] = (n - j + 1) * 1ll * mn + (sum - mn);
		}
		pref[1] = costB[1];
		for (int i = 2; i <= n; ++i) pref[i] = min(pref[i - 1], costB[i]);
		ll ans = inf;
		for (int i = 1; i <= n; i += 2) {
			if (i / 2 + 1 + (i - 1) / 2 <= n)
				ans = min(ans, costA[i / 2 + 1] + costB[(i - 1) / 2]);
			if (i / 2 + 1 + (i + 1) / 2 <= n)
				ans = min(ans, costA[i / 2 + 1] + costB[(i + 1) / 2]);
		}
		cout << ans << '\n';
	}
	return 0;
}