(0, 0). The list points gives the order of placement: points[i] = [x, y] means the i-th beacon went up at (x, y). All points are distinct.
The distance from the base to a beacon at (x, y) is |x| + |y|.
After each placement the base logs the distance to the rank-th closest beacon among those standing so far (beacons at equal distance count separately). If fewer than rank beacons are up, it logs -1.
Return the log, a list of len(points) numbers.points=[[2, -1], [0, 5], [-1, 0], [4, 4]], rank=2 → [-1, 5, 3, 3]
Distances arrive as 3, 5, 1, 8. After the first beacon there is no second-closest one (-1); after that the second smallest is 5, then 3, then 3.
points=[[6, 0], [-3, -3], [0, 1]], rank=1 → [6, 6, 1]
With rank = 1 it is just the closest beacon so far: 6, then 6 (the second one is also at 6), then 1.
points) ≤ 2·10⁵rank ≤ 10⁵points=[[2, -1], [0, 5], [-1, 0], [4, 4]], rank=2
[-1, 5, 3, 3]
Run checks the first 3 tests in your browser. Submit checks all 86 tests on the server, hidden ones included.