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;
  long long po(long long a, long long b) {
    if (b == 0) return 1;
    long long ans = 1;
    if (b % 2 == 0) {
      ans = po(a, b / 2) % 1000000007;
      ans = (ans % 1000000007 * ans % 1000000007) % 1000000007;
    } else {
      ans = po(a, (b - 1) / 2) % 1000000007;
      ans = (ans % 1000000007 * ans % 1000000007 * a) % 1000000007;
    }
    return ans % 1000000007;
  }
  long long power(long long x, long long y, long long p) {
    long long res = 1;
    x = x % p;
    while (y > 0) {
      if (y & 1) res = (res * x) % p;
      y = y >> 1;
      x = (x * x) % p;
    }
    return res;
  }
  vector<string> tokens;
  void separate_string(string line) {
    stringstream check1(line);
    string lav;
    while (getline(check1, lav, '*')) {
      tokens.push_back(lav);
    }
  }
  vector<long long> divisors;
  void get_Divisors(long long n) {
    for (int i = 1; i <= sqrt(n); i++) {
      if (n % i == 0) {
        if (n / i == i) {
          divisors.push_back(n / i);
        } else {
          divisors.push_back(i);
          divisors.push_back(n / i);
        }
      }
    }
  }
  bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
    return (a.second < b.second);
  }
  vector<long long> prim;
  void primeFactors(long long n) {
    while (n % 2 == 0) {
      prim.push_back(2);
      n = n / 2;
    }
    for (long long i = 3; i <= sqrt(n); i = i + 2) {
      while (n % i == 0) {
        prim.push_back(i);
        n = n / i;
      }
    }
    if (n > 2) prim.push_back(n);
  }
  vector<long long> fact(10005);
  long long modInv(long long n, long long p) { return power(n, p - 2, p); }
  long long ncr(long long n, long long r) {
    return (n >= r ? (fact[n] * modInv(fact[r], 1000000007)) % 1000000007 *
                         modInv(fact[n - r], 1000000007) % 1000000007
                   : 0);
  }
  void solve() {
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    long long ma = INT_MIN;
    vector<int> v;
    for (int i = 1; i < n; i++) {
      ma = max(ma, a[i] * 1LL * a[i - 1]);
    }
    cout << ma << "\n";
    return;
    for (int i = 0; i < n; i++) {
      if (a[i] == ma) v.push_back(i);
    }
    long long ans = 0;
    for (int i = 0; i < v.size(); i++) {
      int x = v[i];
      if (x - 1 >= 0) {
        ans = max(ans, a[x] * 1LL * a[x - 1]);
      }
      if (x + 1 < n) {
        ans = max(ans, a[x] * 1LL * a[x + 1]);
      }
    }
    cout << ans << "\n";
  }
  int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int t = 1;
    cin >> t;
    while (t--) {
      solve();
    }
  }
  