Further solving
After lunch at LKSH, students often engage in various activities, but each student makes an effort to visit the computer room to tackle any unresolved problems from their practice sessions.
This year, the weather is exceptionally hot, making the computer room quite stuffy. To prevent overcrowding, it's crucial to monitor the number of students present at any given time. Consequently, the deputy principal has recorded the arrival and departure times of each student in the computer room.
The deputy principal now wishes to determine how many other students each student encountered while in the computer room.
Input
The first line contains the number of students, N (1 ≤ N ≤ 10^5). For each of the following N lines, there are two integers, S_i and T_i (0 ≤ S_i ≤ T_i ≤ 10^9), which represent the arrival and departure times of the i-th student in the computer room.
Output
The output should consist of N integers. The i-th integer should indicate the number of students the i-th student met in the computer room.
If a student arrives at the same time another student departs, they are considered to have met.