4. In how many ways can a bamboo trunk (a non-uniform natural material) 4 m long be sawn into three parts, the lengths of which are multiples of 1 dm, and from which a triangle can be formed?

(12 points)
Solution.

Let $A_{n}$ be the point on the trunk at a distance of $n$ dm from the base. We will saw at points $A_{p}$ and $A_{q}, p<q$. To satisfy the triangle inequality, it is necessary and sufficient that each part is no longer than 19 dm:

$$
p \leq 19, \quad 21 \leq q \leq p+19
$$

Thus, the number of ways to choose $p$ and $q$ will be

$$
\sum_{p=1}^{19}(p+19-20)=0+1+2+\ldots+18=\frac{18 \cdot 19}{2}=171
$$

## Answer: 171