You are given the cartesian coordinates of a set of points in a 2D
plane (in no particular order). Each of these points is a corner point of some Polygon, P
, which is not self-intersecting in nature. Can you determine whether or not is a concave polygon?
The first line contains an integer, N
, denoting the number of points.
The N
subsequent lines each contain 2
space-separated integers denoting the respective x
and y
coordinates of a point.
- 3 <= N <= 1000
- 0 <= x, y <= 1000
Print YES
if P
is a concave polygon; otherwise, print NO
.
4
0 0
0 1
1 1
1 0
NO
The given polygon is a square, and each of its 4
internal angles are 90° . As none of these are over 180°, the polygon is not concave and we print NO
.
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.