Logo
(追記) (追記ここまで)

3201번 - vid 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB111116.667%

문제

N points are given in a plane. Any point has integer coordinates and no two points have the same x coordinates or the same y coordinates.

A pair of points A and B uniquely define a rectangle R(A,B) whose sides are parallel to coordinate axes such that the points A and B are endpoints of one of its diagonals. A pair of two given points A and B are very visible if there are no other given points within a rectangle R(A,B). A pair of points consists of two different points and in this problem pairs (A,B) and (B,A) are regarded to be the samepair and are counted as one pair.

At the beginning a coordinate plane has no given points. Your program should read coordinates of the given points from a file and after reading coordinates of a point, it should write number of pairs of currently very visible given points.

입력

First line of input contains an integer N, 2 ≤ N ≤ 5000, the number of given points.

Each of the following N lines contains two integers X, Y, 0 ≤ X,Y ≤ 1000000 (one million), coordinates of the given points in the order they should be added to the plane.

출력

An output should contain N lines, kth line should contain a number of pairs of very visible given points after taking kth given point into account.

제한

예제 입력 1

3
1 4
3 3
2 5

예제 출력 1

0
1
3

예제 입력 2

4
2 3
3 4
1 2
4 1

예제 출력 2

0
1
2
5

예제 입력 3

7
1 5
2 7
3 8
5 1
6 2
7 3
4 4

예제 출력 3

0
1
2
5
9
13
10

힌트

출처

Olympiad > Croatian Highschool Competitions in Informatics > 2005 > Croatian Olympiad in Informatics 2005 4번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /