#D2242. The Number of the Real Roots of a Cubic Equation
The Number of the Real Roots of a Cubic Equation
The Number of the Real Roots of a Cubic Equation
Description
Since the cubic equation: ax ^ 3 + bx ^ 2 + cx + d = 0 is given, please check the number of positive real roots and the number of negative real roots, respectively.
The number of roots shall be counted including the multiple roots.
Input
The input consists of multiple test cases, and the number is recorded on the first line.
From the second line onward, the coefficients of the cubic equation are written in the form of a b c d. a is not 0, and each number is an integer value from -100 to 100.
Output
For a given cubic equation, output the number of positive real roots and the number of negative real roots separated by a space.
Example
Input
2 1 3 3 1 -10 0 0 0
Output
0 3 0 0
inputFormat
Input
The input consists of multiple test cases, and the number is recorded on the first line.
From the second line onward, the coefficients of the cubic equation are written in the form of a b c d. a is not 0, and each number is an integer value from -100 to 100.
outputFormat
Output
For a given cubic equation, output the number of positive real roots and the number of negative real roots separated by a space.
Example
Input
2 1 3 3 1 -10 0 0 0
Output
0 3 0 0
样例
2
1 3 3 1
-10 0 0 0
0 3
0 0
</p>