{"trustable":false,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n div.illustration {\n float: right;\n padding-left: 20px;\n }\n div.illustration .illustration {\n width: 100%;\n border-radius: 4px;\n }\n pre {\n display: block;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n color: #333;\n word-break: break-all;\n word-wrap: break-word;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eStudenti Confuzi\u0026nbsp;\u003c/p\u003e\n\u003cp\u003eN students are engaged in a drinking game on a street of \u003cspan class\u003d\"tex2jax_process\"\u003e$l$\u003c/span\u003e meters in the old town. Each of them is walking with a constant speed of \u003cspan class\u003d\"tex2jax_process\"\u003e$1$\u003c/span\u003e m/s. When a student reaches an end of the street the game is over for him. When two students meet they have a shot and turn back and start walking in opposite directions. We know the original positions of the students on the street, unfortunately, we do not know the directions in which the students are walking. Your task is to compute the earliest and the latest possible times needed for the game to finish (all students are out).\u003c/p\u003e\n\u003ch2\u003eInput\u003c/h2\u003e\n\u003cp\u003eThe 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 \u003cspan class\u003d\"tex2jax_process\"\u003e$l$\u003c/span\u003e of the street in meters and \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e, the number of tipsy students . These two numbers are followed by \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e integers giving the position of each student on the street as the distance measured from the left end of the street, in no particular order. All input integers are between \u003cspan class\u003d\"tex2jax_process\"\u003e$0$\u003c/span\u003e and \u003cspan class\u003d\"tex2jax_process\"\u003e$1\\, 000\\, 000$\u003c/span\u003e and they are separated by whitespace.\u003c/p\u003e\n\u003ch2\u003eOutput\u003c/h2\u003e\n\u003cp\u003eFor each case of input, output two numbers separated by a single space. The first number is the earliest possible time when the game ends (if the directions of their walks are chosen appropriately) and the second number is the latest possible such time.\u003c/p\u003e\n\u003cp\u003eDrinking the shot and turning around takes no time of course, our students are experts...\u003c/p\u003e\n\u003ctable class\u003d\"sample\" style\u003d\"height: 154px;\" summary\u003d\"sample data\"\u003e\n\u003ctbody\u003e\n\u003ctr style\u003d\"height: 18px;\"\u003e\n\u003cth style\u003d\"height: 18px; width: 99.5781px;\"\u003eSample Input 1\u003c/th\u003e\n\u003cth style\u003d\"height: 18px; width: 111.234px;\"\u003eSample Output 1\u003c/th\u003e\n\u003c/tr\u003e\n\u003ctr style\u003d\"height: 136px;\"\u003e\n\u003ctd style\u003d\"height: 136px; width: 99.5781px;\"\u003e\n\u003cpre\u003e3\n10 3\n2 6 7\u003cbr /\u003e4 1\u003cbr /\u003e1\n214 7\n11 12 7 13\n176 23 191\n\u003c/pre\u003e\n\u003c/td\u003e\n\u003ctd style\u003d\"height: 136px; width: 111.234px;\"\u003e\n\u003cpre\u003e4 8\u003cbr /\u003e1 3\n38 207\n\u003c/pre\u003e\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}