- Prepare
- Functional Programming
- Recursion
- Concave Polygon
Concave Polygon
Concave Polygon
You are given the cartesian coordinates of a set of points in a plane (in no particular order). Each of these points is a corner point of some Polygon, , which is not self-intersecting in nature. Can you determine whether or not is a concave polygon?
Input Format
The first line contains an integer, , denoting the number of points.
The subsequent lines each contain space-separated integers denoting the respective and coordinates of a point.
Constraints
Output Format
Print if is a concave polygon; otherwise, print .
Sample Input
4
0 0
0 1
1 1
1 0
Sample Output
NO
Explanation
The given polygon is a square, and each of its internal angles are . As none of these are over , the polygon is not concave and we print .
Scoring
The percentage score awarded for your submission will be:
100 - 2*(percentage of tests which you solve incorrectly)
If this value is negative, the percentage score for your submission will be 0.
So if you get half or more of the tests incorrect, your score will be a zero.