581466A - Preparing for the Exam
We identify 3 cases for $$$k$$$.
- $$$k=n$$$. Monocarp passes the exam for all question lists.
- $$$k < n-1$$$. Monocarp does not pass the exam for any question list.
- $$$k == n-1$$$. There is one question, $$$q$$$, for which Monocarp does not know the answer. He will pass the exam for list $$$i$$$ only if $$$a_i=q$$$.
Original problem: 2051C - Preparing for the Exam, leads to official tutorial and all solutions including WS solution: 301141282