1993 AIME Problem 2

During a recent campaign for office, a candidate made a tour of a country which we assume lies in a plane. On the first day of the tour he went east, on the second day he went north, on the third day west, on the fourth day south, on the fifth day east, etc. If the candidate went \frac{n^{2}}{2} miles on the n^{\text {th }} day of his tour, how many miles was he from his starting point at the end of the 40^{\text {th }} day?