Problem list
Log in
#icpc00087 · ICPC NWERC 2020

Contest Struggles

Bronze III 5.0 s 2048 MB

Lotte is competing in a programming contest. Her team has already solved $k$ out of the $n$ problems in the problem set, but as the problems become harder, she begins to lose focus and her mind starts to wander.

She recalls hearing the judges talk about the difficulty of the problems, which they rate on an integer scale from $0$ to $100$, inclusive. In fact, one of the judges said that "the problem set has never been so tough, the average difficulty of the problems in the problem set is $d$!"

She starts thinking about the problems her team has solved so far, and comes up with an estimate $s$ for their average difficulty. In hope of gaining some motivation, Lotte wonders if she can use this information to determine the average difficulty of the remaining problems.

Input

The input consists of:

  • One line with two integers $n$ and $k$ ($2\leq n\leq 10^6$, $0 < k < n$), the total number of problems and the number of problems Lotte's team has solved so far.
  • One line with two integers $d$ and $s$ ($0\leq d,s \leq 100$), 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 $10^{-6}$.

Example 1

Input
2 1
70 50
Output
90.00

Example 2

Input
10 3
80 90
Output
75.7142857

Example 3

Input
2 1
100 10
Output
impossible
Source
ICPC NWERC 2020
Appears in
Not part of a ladder, contest or set yet.
Accepted 1 Submissions 2 Acceptance 100% Solvers 1

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code