## Task B-3.4.

While preparing for the competition, Matko discovered a bookstore with good mathematical literature. The bookstore offers 7 different books with problems only in geometry, 4 only in number theory, and 5 only in combinatorics. Furthermore, the store also offers books with problems from exactly two areas. Thus, there are 6 different books with problems in number theory and combinatorics, and 7 with problems in geometry and combinatorics. In how many ways can Matko choose literature from two of all the mentioned areas if he can buy at most two books?
## Solution.

Mother can buy either one or two books.

1 point

If she decides to buy one book, she can choose it in $6+7=13$ ways.

1 point

If she decides to buy two books, the number of ways is calculated based on which two areas she has chosen.

She can choose each book from only one area or one book that contains only one area, and another book that contains two areas, one of which is the same as in the first book.

She can choose a book on geometry and a book on number theory in $7 \cdot 4=28$ ways.

She can choose a book on geometry and a book on combinatorics in $7 \cdot 5=35$ ways.

She can choose a book on number theory and a book on combinatorics in $5 \cdot 4=20$ ways.

She can choose a book on only geometry and a book on geometry and combinatorics in $7 \cdot 7=49$ ways.

She can choose a book on only number theory and a book on number theory and combinatorics in $4 \cdot 6=24$ ways.

She can choose a book on only combinatorics and a book on number theory and combinatorics in $5 \cdot 6=30$ ways.

She can choose a book on only combinatorics and a book on geometry and combinatorics in $5 \cdot 7=35$ ways.

The student can also choose two books from 6 different ones on combinatorics and number theory in $\frac{6 \cdot 5}{2}=15$ ways and two books from 7 different ones on geometry and combinatorics in $\frac{7 \cdot 6}{2}=21$ ways.

Finally, Mother can equip herself with literature from two areas in $13+28+$ $35+20+49+24+30+35+15+21=270$ ways.