Problem 3015 · Medium

Count the Number of Houses at a Certain Distance I

Enumerate house pairs; each pair shortest path uses the direct street or the extra street between x and y.

Open the interactive visualisation