I think the best way to solve the problem is by simultaneous equation as provided by Pulkit . It is logical and easy to remember .