#P2003. xay loves monotonicity

xay loves monotonicity

题目描述

Click here to read PDF of this problem

输入格式

As shown in the PDF.

输出格式

As shown in the PDF

样例

5 
1 3 2 4 5 
0 1 0 1 0 
5 
3 2 4 
1 5 3 
3 1 5 
2 3 5 
3 1 5
0 
1 
2

提示

录题人:chimp