3. Gorjan spent a certain amount of money buying a backpack, a book, and a pen. If the backpack was 5 times cheaper, the pen was 2 times cheaper, and the book was 2.5 times cheaper than the actual price, then Gorjan would have paid 160 denars. If the backpack was 2 times cheaper, the pen was 4 times cheaper, and the book was 3 times cheaper, then Gorjan would have paid 240 denars. How much money did Gorjan spend?
Solution. Let $x$ be the price of the backpack, $y$ the price of the pencil case, and $z$ the price of the book. From the condition of the problem, we have

$$
\frac{x}{5}+\frac{y}{2}+\frac{z}{2.5}=160 \text { and } \frac{x}{2}+\frac{y}{4}+\frac{z}{3}=240
$$

The given equations are equivalent to

$$
2 x+5 y+4 z=1600 \text { and } 6 x+3 y+4 z=2880
$$

If we add these equations and divide the resulting equation by 8, we get

$$
x+y+z=560
$$

Thus, Gorjan spent 560 denars.