问题
Farmer John has just arranged his
Problem credits: Nick Wu
输入
The first line contains
The next line contains
Each of the next
输出
You should write
示例
4 6
3 2 7 5
2 3
2 4
2 5
2 7
4 6
8 10
2
2
3
4
1
0
Farmer John has just arranged his
Problem credits: Nick Wu
The first line contains
The next line contains
Each of the next
You should write
4 6
3 2 7 5
2 3
2 4
2 5
2 7
4 6
8 10
2
2
3
4
1
0