LearnPy Hub
← Arena
AdvancedRating 1800

Inside, Outside or on the Edge?

For each query point, print INSIDE, OUTSIDE or BOUNDARY for the simple polygon (corners given in order).

Input

n; n lines 'x y'; q; q lines 'x y'.

Output

q lines.

Sample 1

Input
4
0 0
4 0
4 4
0 4
4
2 2
4 2
5 5
0 0
Output
INSIDE
BOUNDARY
OUTSIDE
BOUNDARY

Sample 2

Input
3
0 0
6 0
0 6
3
1 1
3 3
4 4
Output
INSIDE
BOUNDARY
OUTSIDE
solution.py
Output appears here
Inside, Outside or on the Edge? · Python Arena problem · LearnPy Hub