4. (7 points) On the board, 37 ones are written. Every minute, Karlson erases two arbitrary numbers and writes their sum on the board, and then eats a number of candies equal to the product of the two erased numbers. What is the maximum number of candies he could have eaten in 37 minutes?
Answer: 666.

Solution: Let's represent 37 units as points on a plane. Each time we combine numbers, we will connect the points corresponding to one group with all the points of the second group with line segments. Note that if we replace numbers $x$ and $y$ with $x+y$, the groups " $x$ " and " $y$ " will be connected by $x y$ line segments. This is the same number of candies that Karlson eats. After 37 minutes, all points will be connected. In total, $\frac{37 \cdot(37-1)}{2}=666$ line segments will be drawn. Therefore, Karlson will eat 666 candies.