The initial rating is . You participate in contests in order, and your performance in the -th contest is .
After each contest, the rating is updated by giving weight to the previous rating and weight to the current performance. The rating after the -th contest is
It is guaranteed that is a positive integer for every ().
Find the final rating .
The input is given in the following format:
For each test case, print the final rating on one line.
In the first case, the rating changes as .
In the first case, each performance equals the current rating, so the rating stays unchanged. In the second case, it changes as .
Each case is given in the following format:
is the number of test cases. Each case gives the initial rating , the number of contests , and the performances in contest order.
| 2 | 63 | No additional constraints. |