Let the saving of A and B are 4p, 5p and the share in cost of gift are 3q, 4q respectively.
According to the question,
For A, 4p - 3q = (2/3) x 4p
⇒ p = 9q/4 ..... (i)
For B, 5p - 4q = 145
⇒ 5 x (9q/4) - 4q = 145 .....[by Eq. (ii)
∴ q = 20
∴ Cost of gift = 3q + 4q = 7 x 20
= ₹ 140