#D12907. RabbitWalking
RabbitWalking
RabbitWalking
Example
Input
8 5 1 2 6 5 6 4 1 3 4 7
Output
11
inputFormat
Input
8 5 1 2 6 5 6 4 1 3 4 7
outputFormat
Output
11
样例
8 5
1 2
6 5
6 4
1 3
4 7
11
Example
Input
8 5 1 2 6 5 6 4 1 3 4 7
Output
11
Input
8 5 1 2 6 5 6 4 1 3 4 7
Output
11
8 5
1 2
6 5
6 4
1 3
4 7
11
By signing up a OpenJudge universal account, you can submit code and join discussions in all online judging services provided by us.