The least number to be added to the numbers to make them divisible by 9 is equal to the difference of the least multiple of 9 greater than the sum of the digits and sum of the digits.Sum of digits = 15.Nearest multiple of 9 greater than sum of digits = 18.Hence 3 has to be added.
Let the price of a pen be 'x' and that of pencil be 'y' Then 87x + 29y = 783Multiplying eqn (i) by 30/29 we get (87x) x 30/29 + (29y) 30/29 = 783 x 30/29∴ 90x + 30y = 810