#P430. 【例75.1】 坐标统计
【例75.1】 坐标统计
Description
Given points on a plane (both and coordinates are integers), for each point, it can "control" all points that are strictly to its lower left (i.e., both and coordinates are less than its own). The number of points it can control is called its "combat power". Output the combat power for each point in order, and finally output the index of the point with the highest combat power (if there are multiple points with the same highest combat power, output the largest index among them).
Input Format
The first line contains a positive integer (); the next lines each describe the coordinates of a point. The -th line contains two positive integers and (), indicating that the point with index has coordinates .
Output Format
Output lines. Lines to each contain an integer, where the -th line is the combat power of the point with index . The -th line contains the index of the point with the highest combat power (if there are multiple, output the largest index).
Sample
6
4 2
6 6
4 8
15 6
11 9
8 140
1
0
1
3
3
6