hope you think it in this way wrote
S+NQ^2 *T = -4Q solve it for N so subtract from both sides an S and will get
S-S +NQ^2 *T = -4Q -S
NQ^2 *T = -4Q -S divide both sides by T and will get
NQ^2 = (-4Q -S)/T divide both sides by Q^2
N = (-4Q -S)/(Q^2 *T)
hope helped