$m$ students, including Kazari, will take an exam tomorrow.
The paper consists of exactly $n$ problems, the $i$-th problem contains $a_i$ correct answers and $b_i$ incorrect answers, i.e. the $i$-th problem contains $a_i + b_i$ candidates in total.
Each student should choose exactly one candidate as answer for each problem. If the answer to a certain problem is correct, then the student will get one point. The student who gets the most points wins.
Students only know the structure of the paper, but they are able to talk with each other during the exam. They decide to choose a subset $S$ of all $n$ problems, and they will only be able to submit answers on these problems.
They want to know the maximum size of $S$ that the winner among them will solve all the problems in $S$ if they take the optimal strategy.
For sample $1$, students can choose $S = \{1\}$,and we need at least $4$ students to guarantee the winner solve the only problem.
For sample $2$, students can choose $S = \{1, 2, 3\}$, and we need at least $24$ students to guarantee the winner solve these three problems, but if $|S| = 4$, we need at least $96$ students, which is more than $50$.