Lifeguard problem

Question

Hints

Answer