Problem
A spreadsheet's cells can reference other cells in their formulas. When one cell's value changes, recompute exactly the cells that transitively depend on it — in an order that respects dependencies, and each affected cell only once. Cells that don't depend on the change must not be recomputed.
Input / Output
Constraints
Example