LIS of Pairs#10821

LIS of Pairs (Editorial)

First, let's count the number of pairs with . Clearly, we should consider only pairs with , and have to count the number of such pairs that b_i<a_j. For this, count the — the number of pairs with a_i < b_i\le x fo