Quadrilateral classification - MarisaOJ: Marisa Online Judge

Quadrilateral classification

Time limit: 1000 ms
Memory limit: 256 MB
Given four points A(xA,yA),B(xB,yB),C(xC,yC),D(xD,yD), 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 xA,yA,xB,yB,xC,yC,xD,yD. ### Output - Print: + CONVEX if the given quadrilateral is convex. + CONCAVE if the given quadrilateral is concave. + CROSSED if the given quadrilateral is crossed. ### Constraints - −109≤x,y≤109. ### Example Input: 00121121 Output: CONCAVE