The goal of this is to get 24 by multiplying the p value with q. q can be any number, as long as it gets to 24 in this scenario.
So your first p value is 4, so you can take 24, and divide it by 4 to get your answer.
24/4=6 then you can check it by multiplying 6*4=24. That means 6 is your first q value.
This will work for the rest of them in that table, except for the 0, because no matter what you multiply that by you cannont get 24. Try it out for yourself, goodluck!