{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tAn army of ants walk on a horizontal pole of length \u003cem\u003el\u003c/em\u003e cm, each with a constant speed of 1 cm/s. When a walking ant reaches an end of the pole, it \u003cspan data-scayt_word\u003d\"immediatelly\" data-scaytid\u003d\"1\"\u003eimmediatelly\u003c/span\u003e 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.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tThe first line of input contains one integer giving the number of cases that follow. The data for each case start with two integer numbers: the length of the pole (in cm) and \u003cem\u003en\u003c/em\u003e, the number of ants residing on the pole. These two numbers are followed by \u003cem\u003en\u003c/em\u003e integers giving the position of each ant on the pole as the distance measured from the left end of the pole, in no particular order. All input integers are not bigger than 1000000 and they are separated by \u003cspan data-scayt_word\u003d\"whitespace\" data-scaytid\u003d\"1\"\u003ewhitespace\u003c/span\u003e.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tFor 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.\u003c/p\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e\r\n2\r\n10 3\r\n2 6 7\r\n214 7\r\n11 12 7 13 176 23 191\r\n\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e\r\n4 8\r\n38 207\u003c/pre\u003e"}}]}