Quadrilateral classification - MarisaOJ: Marisa Online Judge

Quadrilateral classification

Time limit: 1000 ms
Memory limit: 256 MB
Given four points $A(x_A,y_A),B(x_B,y_B),C(x_C,y_C),D(x_D,y_D)$, determine the type of the quadrilateral $ABCD$, convex, concave or crossed. It is guaranteed that no three points are collinear. ### Input - A single line contains eight integers $x_A,y_A,x_B,y_B,x_C,y_C,x_D,y_D$. ### Output - Print: + `CONVEX` if the given quadrilateral is convex. + `CONCAVE` if the given quadrilateral is concave. + `CROSSED` if the given quadrilateral is crossed. ### Constraints - $-10^9 \le x, y \le 10^9$. ### Example Input: ``` 0 0 1 2 1 1 2 1 ``` Output: ``` CONCAVE ```