M varies jointly as the square of n and square root of q. If M…