Hi, this previously posted.
Let x and (x-4) represent the number of matches filling 24 amd 28 boxes respectively
Note: the Total number of matches is the same filling the 24 and 28 boxes
24x = 28(x-4)
solving for x
24x = 28x - 112
112 = 4x
28 = x, the number in each of the 24 boxes
24*28 = 672 is the total number of matches
CHECKING our answer
24boxes*28matches/box = 28boxes*24matches/box = 672