5. There was a whole number of cheese heads on the kitchen. At night, rats came and ate 10 heads, and everyone ate equally. Several rats got stomachaches from overeating. The remaining seven rats the next night finished off the remaining cheese, but each rat could eat only half as much cheese as the night before. How much cheese was there in the kitchen initially?
Solution. Let there be $k$ rats in total $(k>7)$, then each rat ate $\frac{10}{k}$ pieces of cheese on the first night. On the second night, each rat ate half as much, that is, $\frac{5}{k}$ pieces. Then seven rats ate $\frac{35}{k}$ pieces. This is an integer. The only divisor of the number 35 that exceeds 7 is the number 35 itself. Therefore, $\frac{35}{k}=1$, and there were $10+1=$ 11 pieces of cheese in the warehouse before the rat invasion. Answer: 11.