#P1839. Stone Game

Stone Game

题目描述

Click here to read PDF of this problem

输入格式

As shown in the PDF.

输出格式

As shown in the PDF

样例

5 
5 
1 5 4 3 2 
8 
2 1 3 4 5 6 8 7 
8 
4 2 3 1 8 6 7 5 
4 
3 4 2 1 
4 
2 3 1 4 

2 
4 
5 
3 
2 

提示

Codeforces Round #725 (Div. 3) A 题

Input by QLU_张席畅