For this Question: Given an array of N non-negative integers. 
You perform the following operation on the array :
For every index i such that 0 &lt i &lt N, if arr[i] even subtracts the min(arr, 0, i-1) else if the arr[i] is odd add the max(arr, 0, i-1), Where min(arr, 0, i) denotes the minimum of all elements of the array between 0 to i. similarly max(arr, 0, i) denotes the maximum in the given range.
print the maximum and minimum in the array.The first line contains N.
the second line contains N space-separated Integers.

<b>Constraints</b>
1 &le; N &le; 10<sup>5</sup>
0 &le; arr[i] &le;10<sup>9</sup>Two integers denoting the maximum and minimum of the array after the operation.Sample Input:
4
3 1 6 5

Sample Output:
9 3

<b>Explanation:</b>
at index 1 : a[i] = 1, max = 3, min = 3 so a[i] = 1 + 3 = 4
at index 2 : a[i] = 6, max = 4 , min = 3 so a[i] = 6 - 3 = 3
at index 3 : a[i] = 5, max = 4 , min = 3 so a[i] = 5 +2 = 9
after operation : max= 9 min=3, I have written this Solution Code: import java.io.*;
import java.util.*;


public class Main {
    

    
    public static void main(String[] args) {
        
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        
        int n=Integer.parseInt(in.next());
        long a[] = new long[n];
        for(int i=0;i<n;i++){
            a[i]=Long.parseLong(in.next());
        }
        
        long mn=a[0],mx=a[0];
        for(int i=1;i<n;i++){
            if(a[i]%2 == 0){
                a[i] -= mn;
            }
            else if(a[i]%2 != 0){
                a[i] += mx;
            }
            mn=Math.min(a[i],mn);
            mx=Math.max(a[i],mx);
        }
        
        out.print(mx + " "+mn);
        out.close();
    }

    
    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;
        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void println(Object... objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }

        public void println(int i) {
            writer.println(i);
        }

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