* Line 1: Two integers, N and M.
* Lines 2..N+1: Line i+1 contains one integer, Xi, the position of platform i. * Lines N+2..M+N+1: Line i+N+1 contains two integers, Si and Di, respectively the start and end platforms of a slide.
第1行:两个整数N和M,用空格隔开.
第2到N+1行:第i+l行包括一个整数Xi,表示i号中转站距河源头的距离.
第N+2到M+N+1行:第i+N+1行包括两个整数Si和Di,分别表示了一条滑水路线的起点和终点.