The first line contains the regional coefficient L. Then there are pairs N1 S1, N2 S2, ..., Nm Sm, 0 Sm+1. Each pair is located in a separate line. The number in pairs are separated by one or several spaces. The values of L and coefficients Si are given in percents (i.e. they are integers from 0 to 99).
Each of the next lines contains the total annual net profit of the citizen on some enterprise, where he worked, taking into account the regional coefficient and taxes.
The input is ended by −1. All the parameters are integer not greater than 109 within two digits after a decimal point. The number of different workplaces of the citizen doesn't exceed 30. An amount of taxation coefficients (m) is not greater than 20.