Problem A
Ants

An army of ants walk on a horizontal pole of length
Input
The first line of input contains one integer giving the
number of cases that follow, at most 100. The data for each
case start with two integer numbers: the length
Output
For each case of input, output two numbers separated by a single space. The first number is the earliest possible time when all ants fall off the pole (if the directions of their walks are chosen appropriately) and the second number is the latest possible such time.
Sample Input 1 | Sample Output 1 |
---|---|
2 10 3 2 6 7 214 7 11 12 7 13 176 23 191 |
4 8 38 207 |