Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: Median of Lines
Description In the Cartesian plane, there are x) = a + _{i}xb (_{i}i = 1, 2, …, n). For each x, F(x) denotes the median of {f_{1}(x), f_{2}(x), ..., f(_{n}x)}. You are required to find the solution space of the equation F(x) = 0.Input The input contains multiple test cases. Each test case have b (|_{i}a| ≤ 10_{i}^{8}, 0 ≤ b < 10_{i}^{8}). A zero follows the last test case.Output For each test case, output the solution space as an interval on a separate line. Interval boundaries should be rounded to two digits beyond the decimal point. “ `+inf` ” and “`-inf` ” are used to represent positive and negative infinities. The solution space will form at most one interval in this problem. If the solution space is empty, just output “`-1` ”.Sample Input 3 0 0 1 0 0 1 3 0 0 1 2 1 1 3 1 0 2 0 3 0 3 1 1 1 2 1 3 3 0 0 1 0 -1 0 0 Sample Output (-inf,0.00] [-1.00,-0.50] -1 [-0.50,-0.50] (-inf,+inf) Hint Be cautious about outputting “ Illustration of the second test case in the sample input: Source POJ Monthly--2007.04.01, dearboy |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator