Problems
Internal point
Internal point
Given a strictly convex n-polygon and k points.
For each point you need to determine where she is - inside, on the border, or outside.
Input
Number n (3 ≤ n ≤ 105
). Then given n points - the vertices of the polygon.
Number k (0 ≤ k ≤ 105
). Then given k points - the queries.
All coordinates are integer, not exceeding 107
by absolute value.
Output
For each query print on a separate line INSIDE, BORDER or OUTSIDE.
Input example #1
4 0 0 2 0 2 2 0 2 4 1 1 0 0 0 1 0 3
Output example #1
INSIDE BORDER BORDER OUTSIDE