For this Question: Sara's team participated in an eating competition at FoodFest in which they are asked to eat at least P dishes.
Sara's team consists of N members where a member <b>i</b> (1 <= i <= N ) takes <b>Arr[i]</b> minutes to finish a single dish. Your task is to find the minimum time to finish at least P dishes.

Note: A member can eat a dish any number of times.First line of input contains two integers N and P. The next line of input contains N space separated integers depicting the values of Array.

Constraints:-
1 <= N <= 100000
1 <= Arr[i] <= 10
1 <= P <= 1000000000000Print the minimum time taken to eat at least P dishes.Sample Input:-
4 10
1 2 3 4

Sample Output:-
6

Explanation:-
1st member will eat 6 dishes
2nd member will eat 3 dishes
3rd member will eat 2 dishes
4th member will eat 1 dishes
total = 12

Sample Input:-
8 8 
1 1 1 1 1 1 1 1

Sample Output:-
1, I have written this Solution Code: import java.io.*;
import java.util.*;
class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] str = br.readLine().split(" ");
        String[] input = br.readLine().split(" ");
        int n = Integer.parseInt(str[0]);
        long p = Long.parseLong(str[1]);
        long[] arr = new long[n];
        long l = 0;
        long mid = 0;
        long cnt = 0;
        long max = 1000000000000L;
        for (int i = 0; i < n; i++) {
            arr[i] = Long.parseLong(input[i]);
        }
        while (l < max) {
            mid = (l + max)/2;
            cnt = 0;
            for (int i = 0; i < n; i++) {
                cnt += mid / arr[i];
            }
            if (cnt < p) {
                l = mid + 1;
            } else {
                max = mid;
            }
        }
        System.out.println(l);
    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?