Input file: | Standard input | Time limit: | 1 sec | |
Output file: | Standard output | Memory limit: | 512 Mb |
Paulundra is participating in speed climbing competitions. This discipline involves participants undergoing qualification rounds, followed by paired races. The following rules apply during a paired race:
Paulundra won the qualification with the best time and observed the strategy of each of the n participants in the competition. She knows that participant number i plans to complete the route in ti seconds and knows the probability in percentage that this participant will fall pi. Paulundra also knows that she can complete the route in any time between a and b, and the probability of falling at the chosen time x can be calculated as 1 − x − ab − a.
Help Paulundra choose the optimal time xi for each opponent so that the probability of Paulundra's victory is maximized. If there are multiple optimal times, choose the one that is smaller.
The first line of input contains two integers a and b. The second line of input contains an integer n. The following n lines each contain two integers ti and pi.
Output n integers xi.
1 ≤ n ≤ 105
1 ≤ a, b, ti ≤ 109
1 ≤ pi ≤ 100
a < b
No. | Standard input | Standard output |
---|---|---|
1 |
|
|