B2. There are twenty people in a room, with $a$ men and $b$ women. Each pair of men shakes hands, and each pair of women shakes hands, but there are no handshakes between a man and a woman. The total number of handshakes is 106. Determine the value of $a \times b$.
Correct answer: 84 .

Solution 1: Since there are twenty people in the room,
$$
a+b=20 .
$$

Now we use the fact that there are no handshakes between a man and a woman. In a group of $m$ people, there are $m(m-1) / 2$ pairs of people. Hence, the number of handshakes that took place is
$$
\frac{a(a-1)}{2}+\frac{b(b-1)}{2}=106,
$$
which simplifies to
$$
\frac{a^{2}+b^{2}-(a+b)}{2}=106 \Rightarrow a^{2}+b^{2}=212+(a+b)=232 .
$$

Substituting $b=20-a$ into this equation yields
$$
\begin{array}{c}
a^{2}+(20-a)^{2}=232 \Rightarrow a^{2}+\left(400-40 a+a^{2}\right)=232 \\
\Rightarrow 2 a^{2}-40 a+168=0 \Rightarrow 2\left(a^{2}-20 a+84\right)=0 .
\end{array}
$$

This factors as $2(a-14)(a-6)=0$. Therefore, $a=14$ or $a=6$. Since $a+b=20,(a, b)=(14,6)$ or $(6,14)$. Hence, $a \times b=84$.

Solution 2: Since there are 20 people in the room, there are $\frac{20 \times 19}{2}=190$ pairs of people. Out of them exactly $a \times b$ pairs do not shake hands.
Thus, we have $190-a \times b=106$, and so $a \times b=190-106=84$.