Optimization

An offshore oil well is 2km off the coast. The refinery is 4 km down the coast. Laying a pipe in the ocean is twice as expensive as on land. What path should the pipe follow in order to minimize the cost?