He wants the greatest amount of boxes with the same number of brownies and cupcakes in each package.
First, place brownies and cupcakes into a fraction. Then simplify it.
30/42 = 5/7
You divided 6 from each side, so:
The greatest amount of boxes is 6, with 5 brownies and 7 cupcakes going into each one.
hope this helps