B4. A group of $n$ friends wrote a math contest consisting of eight short-answer problems $S_{1}$, $S_{2}, S_{3}, S_{4}, S_{5}, S_{6}, S_{7}, S_{8}$, and four full-solution problems $F_{1}, F_{2}, F_{3}, F_{4}$. Each person in the group correctly solved exactly 11 of the 12 problems. We create an $8 \times 4$ table. Inside the square located in the $i^{\text {th }}$ row and $j^{\text {th }}$ column, we write down the number of people who correctly solved both problem $S_{i}$ and problem $F_{j}$. If the 32 entries in the table sum to 256 , what is the value of $n$ ?
Solution: The answer is 10 .

Solution 1: The sum of all of the numbers written is the sum of all of the number of pairs of problems of the form $\left(S_{i}, F_{j}\right)$ each student solved. The contribution of each student to this sum is the product of the number of problems this student solved in the short-answer part and the number of problems this student solved in the full-solution part. Since each student solved 11 problems, each student solved either 8 short-answer problems and 3 full-solution problems, or 7 short-answer problems and 4 full-solution problems. Let $x$ be the number of students who solved 8 short-answer problems and 3 full-solution problems and $y$ the number of students who solved 7 short-answer problems and 4 full-solution problems. Then the sum of the numbers written down is $8 \times 3 \times x+7 \times 4 \times y=256$. Hence, $24 x+28 y=256$. Dividing both sides by 4 yields $6 x+7 y=64$. Note that $0 \leq x \leq 10$. Substituting each such value of $x$, we get the following values of $y$ :
We note that only $(x, y)=(6,4)$ yields a non-negative integer solution for $x$ and $y$. Hence, the number of students is $x+y=6+4=10$.

Solution 2: Since each person solved 11 of the 12 problems, there was one problem that each person did not correctly solve. Let $s_{i}$ be the number of people who missed problem $S_{i}$ (for $i=1, \ldots 8$ ) and let $f_{j}$ be the number of people who missed problem $F_{j}$ (for $j=1, \ldots 4$ ).

As in Solution 1 , let $x$ be the number of students who solved 8 short-answer problems and 3 full-solution problems, and let $y$ be the number of students who solved 7 short-answer problems and 4 full-solution problems. By definition, $y=s_{1}+s_{2}+\ldots+s_{8}$ and $x=f_{1}+f_{2}+f_{3}+f_{4}$ and $n=x+y$.

Consider the entry in the $i^{\text {th }}$ row and $j^{\text {th }}$ column of our $8 \times 4$ table. This number must be $n-s_{i}-f_{j}$. Adding all 32 entries, we find that $256=32 n-4\left(s_{1}+\ldots+s_{8}\right)-8\left(f_{1}+\ldots+f_{4}\right)=$ $32 n-4 y-8 x=32(x+y)-4 y-8 x=24 x+28 y$. Therefore, $24 x+28 y=256$. We then complete the problem as in Solution 1.

Solution 3: Let $s_{i}, f_{j}$ be as in Solution 2. Then
$$
n=\left(s_{1}+s_{2}+\ldots+s_{8}\right)+\left(f_{1}+f_{2}+f_{3}+f_{4}\right) .
$$

Also as in Solution 2, we have
$$
\begin{aligned}
256 & =32 n-4\left(s_{1}+s_{2}+\ldots+s_{8}\right)-8\left(f_{1}+f_{2}+f_{3}+f_{4}\right) \\
& =32 n-4 n-4\left(f_{1}+f_{2}+f_{3}+f_{4}\right) \\
& =28 n-4\left(f_{1}+f_{2}+f_{3}+f_{4}\right)
\end{aligned}
$$

Therefore, $64=7 n-\left(f_{1}+f_{2}+f_{3}+f_{4}\right)$. Hence, $n \geq 10$. But note that if $n \geq 11$, then
$$
\left(f_{1}+f_{2}+f_{3}+f_{4}\right)=7 n-64=n+(6 n-64)>n .
$$

Since $f_{1}+f_{2}+f_{3}+f_{4}$ is the number of people that missed a full-solution problem, $f_{1}+f_{2}+f_{3}+f_{4}$ is at most the number of people in the group, which is $n$. This contradicts $f_{1}+f_{2}+f_{3}+f_{4}>n$. Hence, $n \geq 11$. This result in conjunction with $n \geq 10$ yields $n=10$.