{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eCaptain Vrungel and his mate Lom were shipwrecked and got to an \r\nuninhabited island. While the captain sought for fresh water in the island \r\njungle, Lom decided to make some fire signals on the beach. He wanted to \r\nburn them all at night to send a distress signal that could be seen from a ship. \u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eWhen captain Vrungel returned to the beach, Lom had already made \u003ci\u003en\u003c/i\u003e bonfires. \r\nCaptain looked at the fires and said that if one set all fires in one line\r\nthey could be seen not only from a ship but from an airplane too.\r\nFind the minimal total distance, that Lom’s fire signals should be moved \r\nto, to be set in one line. \u003c/div\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eFirst line contains an integer \u003ci\u003en\u003c/i\u003e that is the number of fire signals\r\n(2 ≤ \u003ci\u003en\u003c/i\u003e ≤ 1000).\r\nEach of the next \u003ci\u003en\u003c/i\u003e lines contains integers \u003ci\u003ex\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e, \u003ci\u003ey\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e that are the \r\ncoordinates of \u003ci\u003ei\u003c/i\u003e’th fire signal (−10\u003csup\u003e6\u003c/sup\u003e ≤ \u003ci\u003ex\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e, \u003ci\u003ey\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e ≤ 10\u003csup\u003e6\u003c/sup\u003e).\u003c/div\u003e\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eOutput the minimal total distance that Lom should move his fire signals to.\r\nThe answer must be given with absolute or relative error\r\nnot exceeding 10\u003csup\u003e−6\u003c/sup\u003e.\u003c/div\u003e\u003c/div\u003e"}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e4\r\n0 0\r\n0 1\r\n1 1\r\n1 0\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1.414214\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}