7971: Lots of Triangles

内存限制:128 MB 时间限制:1 S 标准输入输出
题目类型:传统 评测方式:文本比较 上传者:
提交:1 通过:1

题目描述

农民约翰正在考虑卖掉他的一部分土地以赚取一点额外收入。

他的土地中一共种植了 N 棵树,每棵树用二维平面上的一个点来描述,没有任何三棵树是共线的。

约翰正在考虑选取其中三棵树作为顶点,将其围成的三角形区域土地出售。

他一共可以在自己的土地上找出 L=(3N) 个不同的由三棵树作为顶点构成的三角形区域。

如果一个三角形区域的内部包含 v 棵树,那么这个三角形区域的价值就是 v

注意,位于顶点的树不计算在内,并且由于没有三棵树是共线的,所以三角形边上也不可能有树。

对于每一个 v=0…N−3,帮助约翰确定在所有 L 个可选三角形区域中,价值为 v 的有多少个。

输入格式

第一行包含整数 N

接下来 N 行,每行包含两个整数 x,y,表示一棵树在二维平面中的横纵坐标。

输出格式

共 N−2 行,第 i 行输出价值为 i−1 的三角形区域的个数。

数据范围

3≤N≤300


Farmer John is thinking of selling some of his land to earn a bit of extra income. His property contains nn trees (3≤N≤300), 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 L=(N3) such lots he can consider, based on all possible triples of trees on his property.

A triangular lot has value vv if it contains exactly vv 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 v=0…N−3, please help FJ determine how many of his LL potential lots have value v.

INPUT FORMAT (file triangles.in):

The first line of input contains N. The following N lines contain the x and y coordinates of a single tree; these are both integers in the range 0…1,000,000.

OUTPUT FORMAT (file triangles.out):

Output N−2 lines, where output line ii contains a count of the number of lots having value i−1.

SAMPLE INPUT:

7
3 6
17 15
13 15
6 12
9 1
2 7
10 19

SAMPLE OUTPUT:

28
6
1
0
0

Problem credits: Lewin Gan

输入样例 复制


输出样例 复制