The Manhattan Positioning System (MPS) is a variant of GPS built for large cities. MPS treats every position as a lattice point on a regular two dimensional grid, and writes a position as a pair of integers (X,Y).
To find its own position, an MPS receiver first measures the distance to a number of beacons. Every beacon has a known, fixed position. MPS signals travel along the streets of the city, that is along the X and Y axes only, and never diagonally across a block. A receiver at (XR,YR) that measures the distance to a beacon at (XB,YB) therefore reads the Manhattan distance ∣XR−XB∣+∣YR−YB∣.
You are given the positions of several beacons and the measured distance from the receiver to each of them. Determine the position of the receiver. The receiver sits on an integer grid point, because MPS does not support fractional coordinates.