The ratio of tax paid by Company A to that paid by Company B is 35:18 according to the provided sample test paper solution