Problem 1847 · Hard

Closest Room

Process queries by decreasing minimum size, add rooms as they become big enough, and binary search a sorted id set for the closest id.

Open the interactive visualisation