LaunchpadCoordinates, Manhattan distance
L5: Star Map
Orimovo's navigators plot nearby stars on a flat grid. Your input starts with station X,Y (where the workshop is) and range R, followed by one star per line as x,y. All coordinates are positive integers and no two stars share a position.
Distances are measured on the grid: the distance between (a,b) and (c,d) is |a − c| + |b − d|. A star is in range if its distance from the station is at most R. For example:
station 5,5 range 4 1,1 6,7 5,2 9,9 3,4 2,6
The stars at 6,7, 5,2, 3,4 and 2,6 are within 4 of the station, so the answer is 4.
How many stars are in range of the station?