class Solution {
public int minimumSize(int[] nums, int maxOperations) {
int left=1;
int right=maxf(nums);
while(left <= right)
{
int y=(left+right)/2;
int ope = 0;
for(int n:nums)
ope+=(n-1)/y;
if(ope<=maxOperations)
right = y-1;
else
left = y+1;
}
return left;
}
public int maxf(int[] n)
{
int re=n[0];
for(int i:n)
re = Math.max(re,i);
return re;
}
}
02-14
257
08-06
144