Problem E
Skattaskrattar
Languages
en
is

When people earn wages they have to pay taxes on them to the government. To calculate how much they should pay, the wages are divided into tax brackets that the government announces, but in each bracket a certain percentage of the wages that fall into that bracket have to be paid.
Let us take an example with three tax brackets:
Bracket |
Wages |
Tax percentage |
|
|
|
|
|
|
|
|
|
Let us presume some person gets
On the other hand, had the person gotten
The year is
The president has been looking into how the tax brackets for
Input
The first line of the input contains two integers
Then there are
Then there are
The tax brackets are given in increasing order, i.e.
Output
The output should contain all wages that pay the same tax in
both tax bracket systems, given in increasing order. If wages
The output is considered correct if each value has an
absolute or relative error of at most
Scoring
Group |
Points |
Constraints |
1 |
40 |
|
2 |
60 |
No further constraints |
Sample Input 1 | Sample Output 1 |
---|---|
3 2 40 1000 30 5000 50 20 500 80 |
0.000000000000000 750.000000000000000 |
Sample Input 2 | Sample Output 2 |
---|---|
2 3 71 14 42 43 5 6 49 20 |
0.000000000000000 |
Sample Input 3 | Sample Output 3 |
---|---|
5 5 86 874 10 2170 18 5738 99 5891 76 98 497 31 3229 75 7670 58 8394 60 |
0.000000000000000 605.436363636363581 1577.380952380952294 17815.375000000003638 |