Children problem

Question

Hints

Answer