luogu#P1715. [USACO16DEC] Lots of Triangles P
[USACO16DEC] Lots of Triangles P
题目描述
Farmer John is thinking of selling some of his land to earn a bit of extra income. His property contains trees (), each described by a point in the 2D plane, no three of which are collinear. FJ is thinking about selling triangular lots of land defined by having trees at their vertices; there are of course such lots he can consider, based on all possible triples of trees on his property.
A triangular lot has value if it contains exactly trees in its interior (the trees on the corners do not count, and note that there are no trees on the boundaries since no three trees are collinear). For every , please help FJ determine how many of his potential lots have value .
输入格式
The first line of input contains .
The following lines contain the and coordinates of a single tree; these are both integers in the range .
输出格式
Output lines, where output line contains a count of the number of lots having value .
题目大意
题目描述
Farmer John 正在考虑出售他的一部分土地以赚取一些额外收入。他的财产包含 棵树(),每棵树由二维平面中的一个点描述,且任意三棵树不共线。FJ 正在考虑出售由三棵树作为顶点定义的三角形地块;显然,他可以考虑的此类地块数量为 ,基于他财产中所有可能的三棵树组合。
一个三角形地块的价值为 ,如果它的内部恰好包含 棵树(顶点上的树不计入,且由于没有三棵树共线,边界上也没有树)。对于每个 ,请帮助 FJ 确定他的 个潜在地块中有多少个地块的价值为 。
输入格式
输入的第一行包含 。
接下来的 行每行包含一棵树的 和 坐标;这些坐标都是 范围内的整数。
输出格式
输出 行,其中第 行输出价值为 的地块数量。
7
3 6
17 15
13 15
6 12
9 1
2 7
10 19
28
6
1
0
0