n1+n2=24, p*0.4=n1*8.31*300, p*0.2=n2*8.31*600, solve for p, n1, n2