Solution to the car race problem.