Then there are two formulas to express the number of boxes B (150-x)/2 and (500-4x)/3.
So we have to
( 150-x)/2=(500-4x)/3
450-3x= 1000-8x
5x=550
The solution is x= 1 10.