We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
long min = machines.Min() * goal / machines.Length;
long max = machines.Max() * goal / machines.Length;
while (min < max)
{
long days = (max + min) / 2;
if (machines.Sum(x => days / x) < goal)
min = days + 1;
else
max = days;
}
return (long)max;
Minimum Time Required
You are viewing a single comment's thread. Return to all comments →
Shorter: