Longest Increasing Subsequence
题号:NC52920
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 32 M,其他语言64 M
Special Judge, 64bit IO Format: %lld

题目描述

Bobo is tired of all kinds of hard LIS (Longest Increasing Subsequence) problems,
so he decides to make himself some easier one.
Bobo wants to build a sequence of integers ,
where x_i lies in the range (that is, ).
Let be the length of longest increasing subsequence of .
It's clear that .
Bobo would like to find g_k which is the number of sequences whose for .
Note that a sequence is a increasing sequence of only if:


输入描述:

The first line contains an integer n (). 
The i-th of the following n lines contains 2 integers a_i, b_i ().

输出描述:

n integers .
示例1

输入

复制
2
1 2
1 2

输出

复制
3 1
示例2

输入

复制
3
1 1
2 2
3 3

输出

复制
0 0 1