#include #include #include using namespace std; int main(){ int t, n, tp, i, j; vector a; long long ans; cin >> t; for (i=0; i> n; a.clear(); for(j=0; j> tp; a.push_back(tp); } sort(a.begin(), a.end()); if (find(a.begin(), a.end(), 0) != a.end()) ans = 0LL; else{ ans = (long long) a.front() * a.back(); if (ans < 0){ auto it = upper_bound(a.begin(), a.end(), 0); ans = (long long) *it * *(it -1); } } cout << ans << "\n"; } return 0; }