输入输出样例说明:
在第2站与第3站间使用加速器,使时间缩短为2。
巴士于t=1时从1出发,t=2时到达2;t=5时从2出发,t=7时到达3。
三名乘客的等待时间分别是7-0=7, 2-1=1, 7-5=2,总等待时间为10。
数据范围:
10% k=0
20% k=1
40% 2<=n<=50, 1<=m<=1000, 0<=k<=20, 0<=Di<=10, 0<=Ti<=500
60% 1<=n<=100, 1<=m<=1000, 0<=k<=100, 0<=Di<=100, 0<=Ti<=10000
100% 1<=n<=1000, 1<=m<=10000, 0<=k<=100,000, 0<=Di<=100, 0<=Ti<=100,000
NOIP2011 DAY2 bus