Question
Assign labeling tasks to people and models. Implement a basic schedule and a balanced schedule. ```python def build_basic_schedule(t: int, m: int, h: int, k: int) -> list: ... def build_balanced_schedule(t: int, m: int, h: int, k: int) -> list: ... ``` Each output row is `(task_id, model_id, person_id)`. ## Requirements - `t`, `m`, and `h` must be positive; `0 <= k <= t`. - Return `[]` when `k == 0`; reject impossible inputs. - Emit exactly `h * k` rows so every person receives `k` distinct tasks. - The basic schedule may use model `0` for every row. - In the balanced schedule, for every prefix and each task, model assignment counts differ by at most one, as do person counts. - Produce deterministic output and explain the cyclic construction or invariant used. ## Follow-ups 1. Incorporate new tasks without rebuilding the entire plan. 2. Limit each person to one task per day. 3. Add skill constraints and task priorities while preserving fairness. 4. Minimize schedule churn after cancellations.