The best way to predict the future is to create it. ~ Peter Drucker
It is known by all that predicting the future is really hard, almost impossible. Sometimes our predictions turn out to be right while other times things do not go as planned. Yet we never, ever give up on planning ahead because of all the perks it has. Knowing the future would probably have the most benefit when investing. If we could know the price of a stock
Well, you see, we actually have a friend who can do this.
Novruz is a psychic who can predict the future with
Can you help Novruz to develop this system and make the best possible transactions?
We recommend you to be careful about percentages and take into account that some bits may be lost during the division process.
The first line contains two space separated integers:
-
$N$ : the number of days -
$Q$ : the number of queries you need to answer
The second line contains
Following
-
$X$ : the day the stock is purchased (0-indexed) -
$A$ : the intended profit percentage
$ 2 \leq N, Q \leq 10^6$
$ 0 \leq X < N$
$ 0 < A \leq 200$
$ 0 \leq stock\ price\ value \leq 10^5 $
Print a single integer in a new line for every query, the minimum number of days Novruz should hold the stock for at least
Print
10 7
127 107 101 121 112 105 111 101 122 120
5 3
9 2
6 5
7 3
5 4
9 4
1 4
1
-1
2
1
1
-1
2