Problem 3535 · Medium

Unit Conversion II

Conversions link units in a tree; one walk from unit zero gives every unit a reference amount, and each query becomes a ratio reported modulo a prime.

Open the interactive visualisation