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;
  const long long mod = 1000000007;
  const long long MOD = 998244353;
  const long long inf = 1e18;
  const long long MAX = 2e5 + 1;
  inline long long add(long long a, long long b) {
    return ((a % mod) + (b % mod)) % mod;
  }
  inline long long sub(long long a, long long b) {
    return ((a % mod) - (b % mod) + mod) % mod;
  }
  inline long long mul(long long a, long long b) {
    return ((a % mod) * (b % mod)) % mod;
  }
  inline long long ceil(long long a, long long b) { return (a + b - 1) / (b); }
  vector<long long> sieve(int n) {
    int *arr = new int[n + 1]();
    vector<long long> vect;
    for (int i = 2; i <= n; i++)
      if (arr[i] == 0) {
        vect.push_back(i);
        for (int j = 2 * i; j <= n; j += i) arr[j] = 1;
      }
    return vect;
  }
  long long pwr(long long x, long long n) {
    x = x % mod;
    if (!n) return 1;
    if (n & 1)
      return mul(x, pwr(mul(x, x), (n - 1) / 2));
    else
      return pwr(mul(x, x), n / 2);
  }
  long long pwrmod(long long b, long long e, long long m) {
    if (e == 0) return 1;
    if (e & 1) return b * pwrmod(b * b % m, e / 2, m) % m;
    return pwrmod(b * b % m, e / 2, m);
  }
  long long modinv(long long n) { return pwr(n, mod - 2); }
  long long inv(long long i) {
    if (i == 1) return 1;
    return (MOD - (MOD / i) * inv(MOD % i) % MOD) % MOD;
  }
  struct cmp {
    bool operator()(const int &k1, const int &k2) { return k1 > k2; }
  };
  struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
      x += 0x9e3779b97f4a7c15;
      x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
      x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
      return x ^ (x >> 31);
    }
    size_t operator()(uint64_t x) const {
      static const uint64_t FIXED_RANDOM =
          chrono::steady_clock::now().time_since_epoch().count();
      return splitmix64(x + FIXED_RANDOM);
    }
  };
  template <typename T1, typename T2>
  using safe_map = unordered_map<T1, T2, custom_hash>;
  template <typename T1>
  using safe_set = unordered_set<T1, custom_hash>;
  void solve() {
    long long N;
    cin >> N;
    vector<long long> arr(N, 0);
    for (int i = 0; i < N; i++) {
      cin >> arr[i];
    }
    long long highest = arr[0];
    long long highestIndex = 0;
    if (N == 1) {
      cout << highest << "\n";
      return;
    }
    long long mx = 0;
    for (int i = 1; i < N; i++) {
      mx = max(mx, arr[i] * arr[i - 1]);
    }
    cout << mx << "\n";
  }
  int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    long long TEST = 1;
    cin >> TEST;
    for (long long tt = 1; tt <= TEST; tt++) {
      solve();
    }
    return 0;
  }
  