No.3421 How Many Peaks?
Problem Statement
Consider the real-valued function $f(x) = ax^3 + bx^2 + cx + d$.
Print Yes if $f(x)$ has two extrema, and No otherwise.
You are given $T$ test cases; find the answer for each of them.
What is an extremum?
For a real-valued function $g(x)$, consider any $b$ in a sufficiently small open interval containing the point $a$.
If $b \neq a \Longrightarrow g(b) < g(a)$ holds, $g(a)$ is called a local maximum, and
if $b \neq a \Longrightarrow g(b) > g(a)$ holds, $g(a)$ is called a local minimum.
Local maxima and local minima are collectively called extrema.
Input
- $1\leq T \leq 10000$
- $-100 \leq a, b, c, d \leq 100$
- All input values are integers.
The input is given from Standard Input in the following format.
$T$ $case_1$ $case_2$ $\vdots$ $case_T$
Each test case is given in the following format.
$a\;b\;c\;d$
Output
Print $T$ lines.
On the $i$-th line, for the $i$-th test case,
print Yes if $f(x)$ has two extrema, and No otherwise.
Sample
Sample 1
Input
2 1 -3 2 1 8 1 7 -3
Output
Yes No
Sample 2
Input
1 0 1 0 0
Output
No
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
まみめ
kidodesu