Because the sum of the fruits left in the five boxes is equal to the sum of the fruits in the original two boxes, the sum of the fruits taken out of the five boxes is equal to the sum of the fruits in the original three boxes. The sum of the fruits taken out of five boxes is equal to 24× 5 = 120kg, so the original sum of the fruits in three boxes is 120kg, and the fruit in each box is = 120 ÷ 3 = 40 (kg).
The formula is: (24× 5) ÷ (5-2)