A power line is to be run to an offshore facility as shown in the figure above. The offshore facility is [math] miles at sea and [math] miles along the shoreline from the power plant. It costs $ 40,000 per mile to lay a power line underground and $ 80,000 per mile to run the line underwater.

How much of the power line should be run underground, and how much underwater to minimize the overall costs?

Length underground (in miles):
Length underwater (in miles):
Minimal cost (in dollars):