#include <bits/stdc++.h>
#ifdef LOCAL
#include "debug.h"
#else
#define debug(...) (void)0
#define debug_if(...) (void)0
#endif

using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	int t;
	cin >> t;
	while (t--) {
		int n;
		cin >> n;
		vector<int> a, b;
		for (int i = 0; i < n; ++i) {
			int x;
			cin >> x;
			if (i & 1) {
				a.push_back(x);
			} else {
				b.push_back(x);
			}
		}
		auto calc = [&](const vector<int>& c) {
			int m = c.size();
			vector<long long> res(m + 1);
			long long sum = 0;
			int minv = INT_MAX;
			for (int i = 0; i < m; ++i) {
				minv = min(minv, c[i]);
				sum += c[i];
				res[i + 1] = (long long)(n - i) * minv + sum - minv;
			}
			return res;
		};
		auto f = calc(a);
		auto g = calc(b);
		debug(f);
		debug(g);
		long long ans = LONG_LONG_MAX;
		for (int i = 1; i < min(f.size(), g.size()); ++i) {
			ans = min(ans, f[i] + g[i]);
			if (i + 1 < g.size()) {
				ans = min(ans, g[i + 1] + f[i]);
			}
		}
		cout << ans << '\n';
	}
	return 0;
}