#P2002. xay loves nim

xay loves nim

题目描述

Click here to read PDF of this problem

输入格式

As shown in the PDF.

输出格式

As shown in the PDF

样例

2 0 
2 2 
3 3
1
5 2 
1 111 
2 222 
3 333 
4 444 
5 555 
3 7
703369008

提示

录题人:chimp