For this Question: There are n candies put from left to right on a table. The candies are numbered from left to right. The i- th candy has weight w[i]. Alice and Bob eat candies.

Alice can eat any number of candies from the left (she can't skip candies, she eats them in a row).

Bob can eat any number of candies from the right (he can't skip candies, he eats them in a row).

Of course, if Alice ate a candy, Bob can't eat it (and vice versa).

They want to be fair. Their goal is to eat the same total weight of candies. What is the most number of candies they can eat in total?First line contains a single integer n.
Next line contains n space separated integers.

<b> Constraints </b>
1 <= n <= 10<sup>5</sup>
1 <= w[i] <= 10<sup>9</sup>A single integer denoting maximum number of candies that can be eaten under given condition.Input:
6
2 1 4 3 4 3

Output:
5

Explanation :
Alice eats first 3 candies. Bob eats last 2 candies., 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 suf[] = new long[n];
        suf[n-1]=a[n-1];
        for(int i=n-2;i>=0;i--){
            suf[i] = suf[i+1] + a[i];
        }
        
        int ans=0;
        int pref=0;
        for(int i=0;i<n-1;i++){
            pref += a[i];
            int l=i+1,r=n-1;
            while(l<r){
                int m=l+(r-l)/2;
                if(suf[m] <= pref){
                    r=m;
                }
                else l=m+1;
            }
            if(suf[l] == pref){
                ans=Math.max(ans,i+1+n-l);
            }
        }
        out.print(ans);
        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?