5. In the warehouse of a store, there is plenty of chocolate in 12 different varieties. The individual prices in kuna per chocolate of each variety are, in order: 11, 12, 15, 16, 20, 21, 25, 26, 27, 28, 29, and 30. In how many different ways can a package of three chocolates be assembled such that the total value in kuna is a number divisible by 5?

## Solution.

The sum of three numbers will be divisible by 5 if the sum of their remainders when divided by 5 is divisible by 5. Therefore, form the sets as follows:

$A_{0}$ is the set of numbers (prices in kuna) that are divisible by $5, A_{1}$ is the set of numbers (prices) that give a remainder of 1 when divided by 5, and so on.

$A_{0}=\{15,20,25,30\}$

$A_{1}=\{11,16,21,26\}$

$A_{2}=\{12,27\}$

$A_{3}=\{28\}$

$A_{4}=\{29\}$

Consider which remainders upon division by 5 the addends can have so that their sum is divisible by 5. This results in 7 possibilities:

a) $0,0,0$

b) $0,1,4$

c) $0,2,3$

d) $1,1,3$

e) $1,2,2$

f) $2,4,4$

g) $3,3,4$

It is necessary to count the different packages for each of the cases mentioned:

a) The price of each of the three chocolates in the package is a number divisible by 5. There are 20 possibilities:
$15+15+15$
$20+20+20$,
$25+25+25$,
$30+30+30$
$15+15+20$,
$15+15+25$,
$15+15+30$,
$20+20+15$,
$20+20+25$,
$20+20+30$,
$25+25+15$,
$25+25+20$,
$25+25+30$,
$30+30+15$,
$30+30+20$,
$30+30+25$,
$15+20+25$,
$15+20+30$,
$15+25+30$,
$20+25+30$.

b) The price of one chocolate is a number divisible by 5, the price of another chocolate is a number that gives a remainder of 1 when divided by 5, and the price of the third chocolate is a number that gives a remainder of 4 when divided by 5.

A number divisible by 5 can be chosen in 4 ways, as it is one of the numbers from the set $A_{0}$. A number that gives a remainder of 1 can also be chosen in 4 ways, and a number that gives a remainder of 4 when divided by 5 is only the number 29, which means there is only one way.

The total number of ways in this case is, therefore, $4 \cdot 4 \cdot 1=16$.

The number 16 can also be obtained by listing all combinations and counting them:
$15+11+29$
$20+11+29$
$25+11+29$,
$30+11+29$,
$15+16+29$,
$25+16+29$,
$30+16+29$,
$15+21+29$,
$25+21+29$,
$30+21+29$,
$20+21+29$
$15+26+29$,
$25+26+29$,
$30+26+29$.

c) The price of one chocolate is a number divisible by 5, the price of another chocolate is a number that gives a remainder of 2 when divided by 5, and the price of the third chocolate is a number that gives a remainder of 3 when divided by 5.

A number divisible by 5 can be chosen in 4 ways, a number that gives a remainder of 2 can be chosen in 2 ways, and a number that gives a remainder of 3 when divided by 5 is only the number 28, which means there is only one way.

The total number of ways in this case is, therefore, $4 \cdot 2 \cdot 1=8$.
$15+12+28$
$20+12+28$
$25+12+28$
$30+12+28$,
$15+27+28$
$20+27+28$
$25+27+28$
$30+27+28$

d) The prices of two chocolates are numbers from the set $A_{1}$, and the price of the third chocolate is a number from the set $A_{3}$. Two chocolates with prices from the set $A_{1}$ can be chosen in 10 ways, while the set $A_{3}$ has only one element. Therefore, there are a total of 10 possibilities:
$11+11+28$
$11+16+28$
$11+21+28$
$11+26+28$
$16+16+28$
$16+21+28$
$16+26+28$
$21+21+28$
$21+26+28$
$26+26+28$.

e) One number must be chosen from the set $A_{1}$ and 2 numbers from the set $A_{2}$. One number from the set $A_{1}$ can be chosen in 4 ways, and 2 numbers from the set $A_{2}$ can be chosen in 3 ways. Therefore, there are a total of 12 possibilities:
$11+12+12$
$11+12+27$
$11+27+27$
$16+12+12$
$16+12+27$
$16+27+27$
$21+12+12$
$21+12+27$
$21+27+27$
$26+12+12$
$26+12+27$
$26+27+27$
f) One element from the set $A_{2}$ can be chosen in 2 ways, and there is only one way to choose two elements from the set $A_{4}$, so there are exactly two possibilities:

$12+29+29$ $27+29+29$.

g) Since the sets $A_{3}$ and $A_{4}$ each have one element, the only possibility is: $28+28+29$.

The total number of packages that can be obtained in the desired way is:

$20+16+8+10+12+2+1=69$.

## NATIONAL MATHEMATICS COMPETITION
5. In the warehouse of a certain store, there are many chocolates of 12 different types left. The individual prices in kuna per one chocolate of each type are, in order: $11,12,15,16,20,21,25,26,27,28$, 29 and 30. In how many different ways can a package of three chocolates be assembled such that their total value in kuna is a number divisible by 5?

## NATIONAL MATHEMATICS COMPETITION