report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
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 ```
Geometry
Three points
Line segment intersection
Line intersection
Quadrilateral classification
Point location
Triangle classification
Polygon area
Distance to polygon
Convex hull
Perpendicular pairs
Maximum quadrilateral
Catching butterflies
Topic
Geometry
Rating 1100
Solution (0) Solution