#P2000. xay loves jumping

xay loves jumping

题目描述

Click here to read PDF of this problem

输入格式

As shown in the PDF.

输出格式

As shown in the PDF

样例

3 2 
1 2 
3 6 
4 1002
3034

提示

The answers are 2,7,1006. 录题人:chimp