package leetcode;

/**
 * https://leetcode.com/problems/minimum-limit-of-balls-in-a-bag/
 */
public class Problem1760 {
    public int minimumSize(int[] nums, int maxOperations) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem1760 prob = new Problem1760();
        System.out.println(prob.minimumSize(new int[]{9}, 1)); // 5
        System.out.println(prob.minimumSize(new int[]{9}, 2)); // 3
        System.out.println(prob.minimumSize(new int[]{9}, 3)); // 3
        System.out.println(prob.minimumSize(new int[]{9}, 4)); // 2
        System.out.println(prob.minimumSize(new int[]{2,4,8,2}, 4)); // 2
        System.out.println(prob.minimumSize(new int[]{7,17}, 2)); // 7
    }
}

@@ -185,130 +185,155 @@
     
-// TODO%0A        return 
+int left = 1;%0A        int right = 1_000_000_00
 0;%0A    
-%7D%0A%0A
     
-public static void main(String%5B%5D args) %7B%0A        Problem1760 prob = new Problem1760()
+while (left %3C right) %7B%0A            int mid = (left + right) / 2;%0A            int count = 0
 ;%0A  
@@ -342,416 +342,258 @@
     
+ 
-System.out.println(prob.minimumSize(new int%5B%5D%7B9%7D, 1)); // 5%0A        System.out.println(prob.minimumSize(new int%5B%5D%7B9%7D, 2)); // 3%0A        System.out.println(prob.minimumSize(new int%5B%5D%7B9%7D, 3)); // 3%0A        System.out.println(prob.minimumSize(new int%5B%5D%7B9%7D, 4)); // 2%0A        System.out.println(prob.minimumSize(new int%5B%5D%7B2,4,8,2%7D, 4)); // 2%0A        System.out.println(prob.minimumSize(new int%5B%5D%7B7,17%7D, 2)); // 7
+   for (int num : nums) %7B%0A                count += (num - 1) / mid;%0A            %7D%0A            if (count %3E maxOperations) %7B%0A                left = mid + 1;%0A            %7D else %7B%0A                right = mid;%0A            %7D%0A        %7D%0A        return left;
 %0A   

Solve problem 1760