Excellent, though there's a minor error in the final case; try p=q=3.
The time you enjoy wasting is not wasted time. Bertrand Russell <- Remember to rate posts you find helpful.
Forum Rules