Choosing the smallest suitcase that fits everything: if size 50 fits, every bigger size fits too, so you only test sizes by halving.
Clues that point here
→ "Minimum capacity/speed/time such that..."
→ "Maximise the minimum" or "minimise the maximum"
→ A yes/no feasibility check is easy to write
→ Large answer range (up to 10^9)
Not this pattern when
✕ The feasibility check isn't monotonic
✕ The answer space is tiny (just try all)
The template
A skeleton to adapt. The parts in comments are what changes from problem to problem.
Binary Search on the Answer · template
int lo = minPossible, hi = maxPossible;
while (lo < hi) {
int mid = lo + (hi - lo) / 2;
if (feasible(mid)) hi = mid; // mid works: try smaller
else lo = mid + 1; // mid fails: need bigger
}
return lo; // smallest feasible answer