Let f(l) =a_l . a_{l+1}

In the first test case ,

* f(1) =
a_1 . a_2
* f(2) = a_2 . a_3

= 2 . 4 = 8.
= 4 . 3 = 12.

* f(1) =
a_1 . a_2
* f(2) = a_2 . a_3

= 2 . 4 = 8.
= 4 . 3 = 12.

So the maximum is f(2, 3) = 12.

So the minimum is f(2, 3) = 8.

In the second test case , the maximum is f(1) = f(2) =
6.

In the second test case , the minimum is f(3) = 3.

72

Competition-Level Code Generation with AlphaCode

Underspeciﬁed

You are given n integers a_1 , a_2 , ... , a_n. Find the
maximum value of (a_l . a_r) over all pairs (l, r)
of integers for which 1 <= l < r <= n.

You are given n integers a_1 , a_2 , ... , a_n. Find the
maximum value of f(a_l , a_r) over all pairs (l, r)
of integers for which 1 <= l < r <= n.

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) .
alphacode