## Task B-2.4.

A pair of pirates on a deserted island found a chest containing gold chains, bracelets, and rings. They began to argue about how they would divide the chains, bracelets, and rings between them. They concluded that they would spend a total of 5865 minutes arguing about every possible distribution if they argued for 5 minutes about each one. Determine how many chains, how many bracelets, and how many rings were in the chest, given that there were the most rings and the fewest bracelets. All chains are identical to each other, as are the bracelets and rings.
## Solution.

Obviously, the total number of possible distributions of the treasure is $5865: 5=1173$.

Let $l$ be the number of gold chains, $n$ be the number of gold bracelets, and $p$ be the number of gold rings.

If the first pirate gets $x$ chains, $y$ bracelets, and $u$ rings, then the second pirate's share is uniquely determined, i.e., he gets $l-x$ chains, $n-y$ bracelets, and $p-u$ rings.

Since $x \in\{0,1,2, \ldots, l\}, y \in\{0,1,2, \ldots, n\}, u \in\{0,1,2, \ldots, p\}$, we conclude that the number of possible distributions of the treasure is $(l+1)(n+1)(p+1)$.

Thus, we obtain the equation $(l+1)(n+1)(p+1)=1173$.

If we factorize the number 1173, we get $(l+1)(n+1)(p+1)=3 \cdot 17 \cdot 23$.

Given the condition that there were the most gold rings and the fewest gold bracelets in the chest, we conclude that $p=22, n=2, l=16$.

There were 16 gold chains, two bracelets, and 22 rings in the chest.