Fresh Air
题号:NC15818
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 32 M,其他语言64 M
64bit IO Format: %lld

题目描述

It’s universally acknowledged that there’re innumerable trees in the campus of HUST.


And you know that, trees have the special ability to refresh the air. If an area, which is surrounded by trees, is separated from the outer atmosphere, you can call it “the supercalifragilisticexpialidocious area”. Students can enjoy the healthiest air there. Then, you happened to know that HUST will plant N trees in a bare plain, so you want to calculate the total size of “the supercalifragilisticexpialidocious area” after each operation.

We describe the position of trees with a coordinate.(Xi,Yi).
For example, after 9 trees were planted, the green area is a supercalifragilisticexpialidocious area, its size is 3.


After planting a new tree in (3,2), its size is 2.

输入描述:

The first line is an integer N as described above.
Then following N lines, each line contains two integer Xi and Yi, indicating a new tree is planted at (Xi,Yi).

输出描述:

Output N lines, each line a integer indicating the total size of supercalifragilisticexpialidocious areas after each operation.
示例1

输入

复制
9
0 1
1 0
2 0
2 1
1 2
3 2
2 3
100 100
1 1

输出

复制
0
0
0
0
1
1
2
2
1