LIS of Pairs
Очень сложная
Ограничение по времени выполнения 1 секунда
Ограничение по использованию памяти 256 мегабайт
You have pairs of integers, where holds for all .
Let's define as the length of the longest strictly increasing subsequence of the sequence .
It's clear that .
For every from to , find the number of ordered pairs with , for which .
Note that a sequence labeled with is an increasing subsequence of only if:
Входные данные
The first line of the input contains integers ().
The -th of the following lines contains integers ().
Выходные данные
Print integers. The -th of them should be equal to the number of ordered pairs with , for which .
Примеры
Ввод #1
Ответ #1
Ввод #2
Ответ #2
Примечание
In the first sample:
.
.
.
.
In the second sample, all numbers are equal, so we wouldn't be able to choose any increasing subsequence of length at least .
Отправки 3