#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long int n, i, max = 0;
    cin >> n;
    long long int arr[n];
    for (i = 0; i < n; i++) {
      cin >> arr[i];
    }
    for (i = 0; i < n - 1; i++) {
      if (arr[i] * arr[i + 1] > max) max = arr[i] * arr[i + 1];
    }
    cout << max << endl;
  }
}
