F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Simple Function

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 545    Accepted Submission(s): 93


Problem Description
Knowing that x can be any real number that x2 + Dx + E ¡Ù 0. Now, given the following function:

What is the range of y?
 

Input
The first line contains a single integer T (T ¡Ü 10000), indicating that there are T cases below.
Each case contains five integers in a single line which are values of A, B, C, D and E (-100 ¡Ü A, B, C, D, E ¡Ü 100).
 

Output
For each case, output the range of y in the form of standard interval expression like in a single line.
The expression is made up by one interval or union of several disjoint intervals.
Each interval is one of the following four forms: "(a, b)", "(a, b]", "[a, b)", "[a, b]"(there is a single space between ',' and 'b'), where a, b are real numbers rounded to 4 decimal places, or "-INF" or "INF" if the value is negative infinity or positive infinity.
If the expression is made up by several disjoint intervals, put the letter 'U' between adjacent intervals. There should be a single space between 'U' and nearby intervals.
In order to make the expression unique, the expression should contain as minimum of intervals as possible and intervals should be listed in increasing order.
See sample output for more detail.
 

Sample Input
5 1 1 1 2 3 0 1 0 1 -10 -3 -1 0 -1 -1 0 0 0 0 0 1 3 0 2 0
 

Sample Output
[0.3170, 1.1830] (-INF, INF) (-INF, -1.8944] U [-0.1056, INF) [0.0000, 0.0000] (-INF, 1.0000) U (1.0000, 1.5000) U (1.5000, INF)
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-19 12:50:55, Gzip enabled