Suppose you move

ft in the

direction. The cost for this would be

. Now the distance between you (now) and the point across the river is
^2 + 30^2})
and the cost for this portion is
^2 + 30^2})
and thus the total cost is
Now minimize C (i.e.

and find l). Don't forget to check the endpoints

(all river) and

(all shore then across).