For this Question: You have N buckets of apples, i<sup>th</sup> bucket has bucket[i] apples.
You plan to eat apples for the next M days. On j<sup>th</sup> day you take the bucket with maximum apples and eat day[j] apples from the bucket. if there is not enough apple in the bucket then you eat all the apples from that bucket.

After M days, what is the maximum number of apples in any bucket?First line contains a single integer N.
Next line contains n space separated integers.
Third line contains M.
Next line contains M space separated integers.

<b>Constraints</b>
1 <= N, M<= 10<sup>5</sup>
1 <= bucket[i], day[i] <= 10<sup>9</sup>A single integer denoting required answer.Input:
3
12 17 10
4
10 8 6 9

Output:
4

Explanation:
day1 =10 => buckets = {12, 17, 10 } => {12, 7, 10}
day2 = 8 => buckets = {12, 7, 10 } => {4, 7, 10}
day3 = 6 => buckets = {4, 7, 10} => { 4, 7, 4 }
day4 = 9 => buckets = {4, 7, 4} => { 4, 0, 4 }
on day4 we needed 9 apples, but the maximum in a bucket was only 7., 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());
        int bucket[] = new int [n];
        for(int i=0;i<n;i++){
            bucket[i] = Integer.parseInt(in.next());
        }
        int m=Integer.parseInt(in.next());
        int day[] = new int [m];
        for(int i=0;i<m;i++){
            day[i] = Integer.parseInt(in.next());
        }
        
        PriorityQueue<Integer> pq=new PriorityQueue<>(Collections.reverseOrder());
        for(int i=0;i<n;i++){
            pq.add(bucket[i]);
        }
        
        for(int i=0;i<m && !pq.isEmpty();i++){
            int x=pq.poll();
            x -= day[i];
            if(x>0)pq.add(x);
        }
        int ans=0;
        if(!pq.isEmpty())ans=pq.peek();
        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?