Let the age of A = x years
And the age of B = y years
Five years ago,
A’s age = (x – 5) years
B’s age = (y – 5) years
According to the question,
(x – 5) = 3(y – 5)
⇒ x – 5 = 3y – 15
⇒ x = 3y – 10 …(i)
Ten years later,
A’s age = (x + 10)
B’s age = (y + 10)
According to the question,
(x + 10) = 2(y + 10)
⇒ x + 10 = 2y + 20
⇒ x = 2y + 10 …(ii)
From Eq. (i) and (ii), we get
3y – 10 = 2y + 10
⇒ 3y – 2y = 10 + 10
⇒ y = 20
On putting the value of y = 20 in Eq. (i), we get
x = 3(20) – 10
⇒ x = 50
Hence, the age of person A is 50 years and Age of B is 20 years.