#include <bits/stdc++.h>
const int maxn = 3e5 + 5;
long long a[maxn];
int n;
long long MAX(long long x, long long y) { return x > y ? x : y; }
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i) {
      scanf("%lld", &a[i]);
    }
    long long maxnum = 0;
    for (int i = 2; i <= n; ++i) {
      maxnum = MAX(maxnum, a[i] * a[i - 1]);
    }
    printf("%lld\n", maxnum);
  }
  return 0;
}
