Problem E
Contest Struggles
She recalls hearing the judges talk about the difficulty of
the problems, which they rate on an integer scale from
She starts thinking about the problems her team has solved
so far, and comes up with an estimate
Input
The input consists of:
-
One line with two integers
and ( , ), the total number of problems and the number of problems Lotte’s team has solved so far. -
One line with two integers
and ( ), the average difficulty of all the problems and Lotte’s estimate of the average difficulty of the problems her team has solved.
Output
Assuming Lotte’s estimate is correct, output the average
difficulty of the unsolved problems, or “impossible” if the average difficulty does not
exist. Your answer should have an absolute or relative error of
at most
Sample Input 1 | Sample Output 1 |
---|---|
2 1 70 50 |
90.00 |
Sample Input 2 | Sample Output 2 |
---|---|
10 3 80 90 |
75.7142857 |
Sample Input 3 | Sample Output 3 |
---|---|
2 1 100 10 |
impossible |