- Time limit: 1.00 s
- Memory limit: 512 MB
What is your maximum reward if you act optimally?
The first input line has an integer $n$: the number of tasks.
After this, there are $n$ lines that describe the tasks. Each line has two integers $a$ and $d$: the duration and deadline of the task.
Print one integer: the maximum reward.
- $1 \le n \le 2 \cdot 10^5$
- $1 \le a,d \le 10^6$