description: You are given n integers a_1, a_2, …, a_n. Find the maximum value of max(a_l, a_{l + 1}, …, a_r) ⋅ min(a_l, a_{l + 1}, …, a_r) over all pairs (l, r) of integers for which 1 ≤ l < r ≤ n.
  
  Input
  
  The first line contains a single integer t (1 ≤ t ≤ 10 000) — the number of test cases.
  
  The first line of each test case contains a single integer n (2 ≤ n ≤ 10^5).
  
  The second line of each test case contains n integers a_1, a_2, …, a_n (1 ≤ a_i ≤ 10^6).
  
  It is guaranteed that the sum of n over all test cases doesn't exceed 3 ⋅ 10^5.
  
  Output
  
  For each test case, print a single integer — the maximum possible value of the product from the statement.
  
  Example
  
  Input
  
  
  4
  3
  2 4 3
  4
  3 2 3 1
  2
  69 69
  6
  719313 273225 402638 473783 804745 323328
  
  
  Output
  
  
  12
  6
  4761
  381274500335
  
  Note
  
  Let f(l, r) = max(a_l, a_{l + 1}, …, a_r) ⋅ min(a_l, a_{l + 1}, …, a_r).
  
  In the first test case, 
  
    * f(1, 2) = max(a_1, a_2) ⋅ min(a_1, a_2) = max(2, 4) ⋅ min(2, 4) = 4 ⋅ 2 = 8. 
    * f(1, 3) = max(a_1, a_2, a_3) ⋅ min(a_1, a_2, a_3) = max(2, 4, 3) ⋅ min(2, 4, 3) = 4 ⋅ 2 = 8. 
    * f(2, 3) = max(a_2, a_3) ⋅ min(a_2, a_3) = max(4, 3) ⋅ min(4, 3) = 4 ⋅ 3 = 12. 
  
  
  
  So the maximum is f(2, 3) = 12.
  
  In the second test case, the maximum is f(1, 2) = f(1, 3) = f(2, 3) = 6.
solution: #include <bits/stdc++.h>
  using namespace std;
  void setIO(string name = "") {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    if (int((name).size())) {
      freopen((name + ".in").c_str(), "r", stdin);
      freopen((name + ".out").c_str(), "w", stdout);
    }
  }
  long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
  long long mcm(long long a, long long b) { return (a * b) / gcd(a, b); }
  bool prime(long long n, long long i) {
    if (i > sqrt(n)) return true;
    if (n % i == 0)
      return false;
    else
      return prime(n, i + 1);
  }
  struct compii {
    bool operator()(const pair<int, int>& a, const pair<int, int>& b) {
      if (a.first == a.second) return a.second < b.second;
      return a.first > b.first;
    }
  };
  bool comp(int a, int b) { return a > b; }
  namespace operators {
  template <typename T1, typename T2>
  istream& operator>>(istream& in, pair<T1, T2>& x) {
    in >> x.first >> x.second;
    return in;
  }
  template <typename T1, typename T2>
  ostream& operator<<(ostream& out, pair<T1, T2> x) {
    out << x.first << " " << x.second;
    return out;
  }
  template <typename T1>
  istream& operator>>(istream& in, vector<T1>& x) {
    for (auto& i : x) in >> i;
    return in;
  }
  template <typename T1>
  ostream& operator<<(ostream& out, vector<T1>& x) {
    for (auto& i : x) out << i << " ";
    return out;
  }
  template <typename T1, typename T2>
  ostream& operator<<(ostream& out, vector<pair<T1, T2>>& x) {
    for (auto& i : x) out << i.first << " " << i.second;
    return out;
  }
  template <typename T1, typename T2>
  istream& operator>>(istream& in, vector<pair<T1, T2>>& x) {
    for (auto& i : x) in >> i.first >> i.second;
    return in;
  }
  }  // namespace operators
  using namespace operators;
  int dx[] = {1, 0, -1, 0};
  int dy[] = {0, 1, 0, -1};
  const int mod = 1e9 + 7;
  const long long inf = 1e18;
  void solve() {
    int n;
    cin >> n;
    vector<long long> a(n);
    cin >> a;
    if (n == 2) {
      cout << a[1 - 1] * a[2 - 1] << endl;
      return;
    }
    long long ans = 0;
    for (int i = 1; i < n - 1; i++) {
      ans = max(ans, a[i] * a[i - 1]);
      ans = max(ans, a[i] * a[i + 1]);
    }
    cout << ans << endl;
  }
  int main() {
    setIO("");
    int t = 1;
    cin >> t;
    while (t-- > 0) solve();
    return 0;
  }
  