For this Question: You are given an array A of size N. Over all pairs of (l, r) (1 <= l < r <= n), find the maximum value of max(A<sub>l</sub>, A<sub>l+1</sub>,... , A<sub>r</sub>) * min(A<sub>l</sub>, A<sub>l+1</sub>,... , A<sub>r</sub>).The first line of the input contains a single integer N.
The second line of the input contains N space seperated integers.

Constraints:
1 <= N <= 10<sup>5</sup>
1 <= A<sub>i</sub> <= 10<sup>9</sup>Over all pairs of (l, r) (1 <= l < r <= n), print the maximum value of max(A<sub>l</sub>, A<sub>l+1</sub>,. , A<sub>r</sub>) * min(A<sub>l</sub>, A<sub>l+1</sub>,. , A<sub>r</sub>).Sample Input:
4
2 3 2 1

Sample Output:
6

Explaination:
Let l = 1, r = 3
max = 3, min = 2
value = 3*2 = 6.
It can be verified that this is the maximum such value possible., I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
    public static void main (String[] args) throws Exception{

        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        int n=Integer.parseInt(br.readLine());
        long[] a= new long[n];

        String[] line=br.readLine().split(" ");
        for(int i=0;i<n;i++){
            a[i]=Long.parseLong(line[i]);
        }
        int i=0,j=i+1;
        long prod=a[i]*a[j];

        while(j<n-1){
            i++;
            j++;
            prod=Math.max(prod,(a[i]*a[j]));
        }

        System.out.println(prod);

    }

}, In this Programming Language: Java, Now tell me if this Code is compilable or not?