Question 365685
j+m = 27, this means m = 27-j.
also it is given that m+2j = 40.
Hence 27-j+2j = 40 or j = 13, and m = 14.  Therefore john is 13 yrs old, and mary is 14 yrs old.