Time limit
2s
Memory limit
128 MB
A math-loving monkey has escaped from a zoo and, while exploring the world, invents a problem using (N) lines.
You are given (N) lines on the coordinate plane and an integer (K). Each line has the form (f_i(x)=a_i \times x+b_i). For a real number (x), define (g(x)) as the median of ({f_1(x), f_2(x), \ldots, f_N(x)}). Find every real number (x) such that (g(x)=K).
The first line contains the number of lines (N) and the integer (K). (N) is an odd integer between (3) and (1{,}000{,}000), inclusive, and (K) is an integer between (-100{,}000) and (100{,}000), inclusive.
Each of the next (N) lines contains two integers (a_i) and (b_i), describing one line. For every (i), (0 \le a_i \le 1{,}000{,}000) and (-1{,}000{,}000 \le b_i \le 1{,}000{,}000). No two given lines are identical.
Print two values on the first line: the beginning and the end of the interval of all (x) such that (g(x)=K). Finite values must be rounded to three digits after the decimal point.
If an endpoint goes to infinity, print +inf for positive infinity and -inf for negative infinity. If no such (x) exists, print impossible. The input is guaranteed to have at most one answer interval.
Do not print -0.000. Values strictly between (-0.0005) and (0.0005) should be printed as 0.000.