#include using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { cin.tie(nullptr)->sync_with_stdio(false); int t; cin >> t; while (t--) { int n; cin >> n; vector a(n); rep(i, n) cin >> a[i]; sort(a.begin(), a.end()); if (a.front() >= 0 || a.back() <= 0) { cout << a.front() * a.back() << '\n'; } else { auto it1 = lower_bound(a.begin(), a.end(), 0LL); assert(it1 != a.begin()); auto it2 = prev(it1); cout << *it1 * *it2 << '\n'; } } return 0; }