Problem3354--【Div4】模拟算法练习 - 牌堆

3354: 【Div4】模拟算法练习 - 牌堆

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description



Sample Input Copy

6
2
1 4
1 3
2
2
2

Sample Output Copy

0
3
4
0

HINT

Source/Category