#C9327. Maximum Adjacent Elements Product

    ID: 53408 Type: Default 1000ms 256MiB

Maximum Adjacent Elements Product

Maximum Adjacent Elements Product

Given an array of integers, your task is to find the maximum product of any two adjacent elements in the array. In other words, for an array a of size n, compute

\( \max_{0 \leq i < n-1} (a_i \times a_{i+1}) \).

The input will be given via standard input where the first line contains a single integer n (the number of elements), followed by a second line containing n space-separated integers. The output should be written to standard output and consist of the maximum product found.

For example, given the array [3, 6, -2, -5, 7, 3], the maximum product is 21.

inputFormat

The first line of the input contains a single integer n (n ≥ 2) which represents the number of elements in the array. The second line contains n space-separated integers representing the elements of the array.

outputFormat

Output a single integer which is the maximum product of any pair of adjacent elements in the array.

## sample
6
3 6 -2 -5 7 3
21