If M varies directly as N and inversely as the root of P. Given that…