A queue holds `tasks` in order, where tasks[i] is the work units of the i-th task. Each shift can do at most C units of work and processes tasks in order (a task is never split across shifts). Return the minimum capacity C so that all tasks finish within `shifts` shifts.