first I would start plugging the values into the volume equation for a pyramid.

then I would multiply both sides of the equation by 3 to get rid of the dividing

then I divide both dies by 9 to solve for B

Then I would just find combination s of numbers that when multiplied equal 28, I would just find all of the pairs then rule out the ones that dont have a difference of 3, the one(s) left should be your base dimensions.
I did this and got 4 and 7