## [POJ1852]蚂蚁

 Grade Open Time Friday, 19 September 2014, 10:08 am Discount 0.8 Time Discount Friday, 26 September 2014, 10:08 am Allow late Yes Close Time Friday, 26 September 2014, 10:08 am Input file pojants.in Output file pojants.out

### 【题目描述】

An army of ants walk on a horizontal pole of length l cm, each with a constant speed of 1 cm/s. When a walking ant reaches an end of the pole, it immediatelly falls off it. When two ants meet they turn back and start walking in opposite directions. We know the original positions of ants on the pole, unfortunately, we do not know the directions in which the ants are walking. Your task is to compute the earliest and the latest possible times needed for all ants to fall off the pole.

### 【样例输入】

2
10 3
2 6 7
214 7
11 12 7 13 176 23 191


### 【样例输出】

4 8
38 207


### 【提示】

horizontal pole 水平杆

constant speed 恒速