Problem

20 /21


Maximum product of adjacent elements

Problem

The input of the program is a natural number N, and then N integers. It is necessary to determine the maximum product of adjacent elements of the sequence. N does not exceed 10000, each element of the sequence does not exceed 100 in absolute value.
 

 

Examples
# Input Output
1
7
2
3
-2
-3
-1
4
6
72
Explanations: the largest product can be obtained for the sequence -3 -1 4 6.