I'm going to assume you meant to write it so that the entire expression (q+r) is in the denominator. Otherwise, I don't think this will work out.
40(r+r^2)/(q+r)-17=p.
First note that that 40-17=23. But 40 is getting multiplied by (r^2+r)/(q+r). Notice that this expression MUST be greater than 1. We can see this if we compare the numerator and denominator term by term: r^2 must be greater than q, because we are told that 1<q<r, and r=r, so r^2+r>q+r. Therefore this entire expression must be greater than 1. As a result, 40 will be increased when it is multiplied by (r^2+r)/(q+r), so p must be greater than 23.
Ans: E