Problem list
Log in
#r03120 · Online Judge > GoldOJ

Clear Superiority Rank

Silver V 2.0 s 1024 MB

Each student has two subject scores. A student strictly dominates another if both scores are higher. Each student's rank is one plus the number of students who strictly dominate them. Print all ranks in input order, space-separated on one line.

Input

Line 1: $N$ ($2 \le N \le 200$). Next $N$ lines: two scores $A$, $B$ ($0 \le A, B \le 100$).

Output

Print the $N$ ranks in input order.

Example 1

Input
5
80 90
90 80
85 95
70 70
100 100
Output
3 2 2 5 1
Source
Online Judge > GoldOJ
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code