#include <bits/stdc++.h>
using namespace std;
unsigned long long a[1000000 + 9];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i];
    unsigned long long ans = 0;
    for (int i = 1; i < n; i++) {
      ans = max(ans, a[i] * a[i - 1]);
    }
    cout << ans << endl;
  }
}
