#BZOJ4995. Why Did the Cow Cross the Road

Why Did the Cow Cross the Road

5 4
7
8
6
2
9
2 5
4 9
0 3
8 13
3