Problem 8.7. Along an alley, maples and larches were planted in one row, a total of 75 trees. It is known that there are no two maples between which there are exactly 5 trees. What is the maximum number of maples that could have been planted along the alley?
Answer: 39.

Solution. Let's divide all the trees into groups of 12 standing in a row. There will be 6 complete groups and 3 more trees at the end. In each group, we will divide the trees into 6 pairs: the first with the seventh, the second with the eighth, ..., the sixth with the twelfth. Note that there are exactly 5 other trees between the trees in one pair, which means that there is at most one maple tree in this pair. Therefore, in each group of 12 consecutive trees, there are no more than 6 maple trees, so in total there are no more than $6 \cdot 6+3=39$ maple trees.

It remains to show that 39 maple trees could have been planted. We will alternate groups of 6 maple trees with groups of 6 deciduous trees; at the end, we will plant a group of three maple trees. Then it is clear that there will be no more than 4 trees between two maple trees in one group, and no less than 6 trees between two maple trees in different groups.