I can't figure out what formula to use to solve this

A city block 500 feet by 500 feet is an unobstructed paved lot, except for a small office building 100 feet by 100 feet, centered in the middle of the block. What's the shortest distance from the SW corner to the NE corner, going through the paved lot and along (but not through) the building (to the nearest foot)?