Lottery problem

Question

Hints

Answer