Problem Statement
给定由(0,0),(1,0),...,(m,0),(m,1),...(m,m),(m-1,m),...(0,m),(0,m-1),...(0,1)这4m个点围成的正方形。
正方形内部有若干个点(不超过20个,不在边界上,点的坐标都是整数),
要求在正方形上选取三个点并且给定的点都在这三个点围成的三角形内部或边上,
求选取这三个点的方案数。(2 <= m <= 58585)
You are given an int m.
Consider a square in the plane such that the corners of the square have coordinates (0, 0), (m, 0), (m, m), and (0, m).
All the lattice points on the boundary of this square are red.
That is, the red points have coordinates (0, 0), (1, 0), ..., (m, 0), (m, 1), ..., (m, m), (m-1, m), ..., (0, m), (0, m-1), ..., and (0, 1).
Some other lattice points are black.
Each black point lies strictly inside the square.
You are given two int[]s: x and y.
These describe the black points:
For each i, there is a black point at (x[i], y[i]).
You want to draw a triangle such that:
- all three of its vertices are red,
- all black points lie inside or on the boundary of the triangle.
Return the number of ways to draw such a triangle.