Simple interest formula I = P x R x T where
P is the Principal amount of money to be invested at an Interest Rate R% per period for T Number of Time Periods.
Interest received in 2009 from Company B = 20000 x 145 x 1/100 = 2900
Hence, their amount = 20000 + 2900 = Rs. 22900
Interest will be received in 2010 from company A = 22900 x 12.5 x 1/100 = Rs. 2862.50
Hence, total amount of interests for both years = 2900 + 2860.50 = Rs. 5762.50