Youngseon plans to start a convenience store. Most of the preparation is done, but the store's location is not decided yet. From market research, Youngseon knows where the main customers are, and wants to place the store so that the sum of the distances to all customers is as small as possible. The distance between two locations (x1,y1) and (x2,y2) is defined as ∣x1−x2∣+∣y1−y2∣.
You are given the locations (xi,yi) of n main customers. If the store is built at a location that minimizes the sum of distances to all customers, what is that minimum sum?