eolymp
bolt
Try our new interface for solving problems
Problems

Conditional statement - 4

Conditional statement - 4

Find the value of $y$ according to condition: $$ y = \begin{cases} x^3 + 2x^2 +4x - 6, x \ge 0 \\ x^3 - 7x, x < 0 \end{cases} $$ \InputFile One integer $x~(-1000 \le x \le 1000)$. \OutputFile Print the value of $y$ according to the conditional statement above.
Time limit 1 second
Memory limit 128 MiB
Input example #1
3
Output example #1
51
Input example #2
-2
Output example #2
6