On a blackboard, Kiara wrote 20 integers, all of them different from zero. Then, for each pair of numbers written by Kiara, Yndira wrote on the same blackboard the respective product between them (including, if the result of some product was already written, Yndira repeated it).

For example, if the numbers 2, 3, 4, and 6 were among those written by Kiara, then Yndira would have written the numbers $6, 8, 12, 12, 18$, and 24, because we have $6=2 \times 3$, $8=2 \times 4$, $12=2 \times 6=3 \times 4$, $18=3 \times 6$, and $24=4 \times 6$. Note that the number 6 would have been written again even though it was already written by Kiara, while the number 12 would have been written twice by Yndira.

a) In total, how many numbers were written by Kiara and Yndira on the blackboard?

b) Suppose that, of the total numbers written on the blackboard, exactly 120 are positive. If Kiara wrote more positive numbers than negative ones, how many of the numbers written by Kiara were positive?
Solution

a) The number of numbers written by Yndira is equal to the number of pairs that can be formed with the 20 numbers written by Kiara.

In how many ways can we choose a pair of elements from a set containing 20 elements? For the choice of the first element, we have 20 possibilities. For each fixed choice of the first element, we have 19 possibilities left for the choice of the second element. Thus, at this moment, we have up to $20 \times 19$ choices. Since the order does not matter (choosing element $A$ and then element $B$ is the same as choosing element $B$ and then element $A$), in the count $20 \times 19$, each pair is counted twice. Therefore, we must divide $20 \times 19$ by 2 to get the number of pairs. In summary, the number of pairs that can be chosen from 20 elements is

$$
\frac{20 \times 19}{2}=190
$$

Thus, the number of numbers written by Yndira was 190. Since Kiara had already written 20 numbers on the board, we have a total of $20+190=210$ numbers written on the blackboard.

b) If out of the total numbers written on the board, there are 120 positive numbers, then, by part a), there are $210-120=90$ negative numbers written. Let $p$ be the number of positive numbers written by Kiara. Then the number of negative numbers written by her is equal to $20-p$. For Yndira to obtain a negative product, she needs to multiply one of the $20-p$ negative numbers by one of the $p$ positive numbers. Therefore, the number of negative numbers written by Yndira is equal to $(20-p) p$. Thus, the total number of negative numbers written on the blackboard is equal to $(20-p)+(20-p) p=(20-p)(p+1)$. Therefore, we have that $(20-p)(p+1)=90$, which can be rewritten as:

$$
p^{2}-19 p+70=0
$$

Solving this quadratic equation, we find that the only values of $p$ that satisfy this equation are $p=5$ and $p=14$. But since Kiara wrote more positive numbers than negative ones, we must have that $p>10$. Therefore, it follows that $p=14$, that is, Kiara wrote 14 positive numbers on the board.