There are 11 buildings alongside a straight highway. We need to select only one of building to be a community gas station. To save money and gas, the location of the gas station should be chosen so that the total sum of all distances between each building and the gas station is minimum.
For the following configuration, where is the best building for the gas station?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Given any two buildings, say, A and K, then any location for a community gas station will result in the same total sum of distances---provided it's between A and K. So, we want to find the building with an equal number of other buildings on either side of it. In this case, that would be building F.