PivotOJ

Quadrants

시간 제한: 2000ms메모리 제한: 2048MB출처: ICPC Asia Seoul Regional 2025BOJ 34870

문제

This problem is about quadrants. What are quadrants? Let us begin with any two perpendicular lines \ell and \ell ' in the plane R2\mathbb{R}^2. If you subtract the two lines \ell and \ell ' from the whole plane R2\mathbb{R}^2, you obtain four connected, unbounded regions. Each of the four regions is called a quadrant. Note that the boundary of a quadrant does not belong to itself.

Now, consider a set PP of points in the plane R2\mathbb{R}^2. We are interested in quadrants defined by the set PP of points. Specifically, let Q\mathcal{Q} be the set of quadrants QQ such that the boundary of QQ contains exactly three points of PP. Each quadrant Q ∈ \mathcal{Q} is called a kk-quadrant if QQ contains exactly kk points of PP in its interior. The figure below shows an example in which the set PP consists of 1414 points (small circles) and you can see a 55-quadrant Q ∈ \mathcal{Q} (shaded in cyan), whose boundary contains three points p, q, r ∈ P.

Given a set PP of nn points as input, write a program that computes the number of kk-quadrants for every 0 ≤ k ≤ n − 3.

입력

Your program is to read from standard input. The input starts with a line containing a single integer nn (3 ≤ n ≤ 2\,000), where nn is the number of points in the input set PP. In each of the following nn lines, given are two integers xx and yy, both ranging from −10^6 to 10610^6, inclusively, that represent the xx- and yy-coordinates of an input point (x,y)(x, y) in PP. You may assume that no two input points have the same coordinates, that there are no three points in PP lying in a line, and that there are no two perpendicular lines \ell and \ell ' in the plane R2\mathbb{R}^2 such that | \ell ∩ P| ≥ 2 and |\ell ' ∩ P| ≥ 2.

출력

Your program is to write to standard output. Print exactly n − 2 lines. The ii-th line of your output for each 1 ≤ i ≤ n − 2 must contain a single integer that represents the number of (i − 1)-quadrants with respect to the input set PP of nn points.

예제

예제 1

입력
3
0 0
1 2
-1 4
출력
2

예제 2

입력
4
0 0
1 2
-1 4
-1 1
출력
0
4

예제 3

입력
10
47 20
4 30
3 21
44 12
46 34
18 18
19 50
48 23
22 3
19 22
출력
2
12
20
18
20
30
28
16
코드를 제출하려면 로그인하세요.