For this Question: Given an array of N integers, your task is to find the maximum value of a given function F(i, j).

<b>F(i, j) = |Arr[i] - Arr[j]| + |i - j|</b>,The first line of input contains a single integer N, the next line of input contains N space- separated integers depicting the values of the array.

Constraints:-
1 <= N <= 100000
-100000 <= Arr[i] <= 100000Print a single integer containing the maximum value of the given function.Sample Input:-
3
1 3 -1

Sample Output:-
5

Explanation:-
f(1, 1) = f(2, 2) = f(3, 3) = 0
f(1, 2) = f(2, 1) = |1 - 3| + |1 - 2| = 3
f(1, 3) = f(3, 1) = |1 - (-1)| + |1 - 3| = 4
f(2, 3) = f(3, 2) = |3 - (-1)| + |2 - 3| = 5

Sample Input:-
4
1 2 3 4

Sample Output:-
6, I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
	public static void main (String[] args) throws IOException {
		BufferedReader scan=new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.parseInt(scan.readLine());
		String s[]=scan.readLine().split(" ");
		int mx1=Integer.MIN_VALUE,mn1=Integer.MAX_VALUE,ans1=-1;
		int mx2=Integer.MIN_VALUE,mn2=Integer.MAX_VALUE,ans2=-1;
		for(int i=0;i<n;i++)
		{
			int temp=Integer.parseInt(s[i]);
			mx1=Math.max(mx1,temp+i);
			mn1=Math.min(mn1,temp+i);

			mx2=Math.max(mx2,temp-i);
			mn2=Math.min(mn2,temp-i);
		}
		ans1=(mx1-mn1);
		ans2=(mx2-mn2);
		int ans=Math.max(ans1,ans2);
		System.out.print(ans);



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