Ferry problem

Question

Hints

Answer