{"trustable":true,"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":"\n \u003cp\u003eYou are operating a taxi company in the Land of Bytes, which\n is an interesting city. First, all roads in the city either\n along the north-south direction or along the east-west\n direction. Second, it’s an extremely large city such that the\n sizes of blocks between different roads are negligible.\n Therefore, each position in this city can be represented by\n coordinates \u003cspan class\u003d\"tex2jax_process\"\u003e$(x, y)$\u003c/span\u003e of\n real values.\u003c/p\u003e\n \u003cp\u003eThe taxi drivers always takes the shortest path between the\n pick-up and drop-off points, following streets. Your company\n only operates the taxis within the central business district\n (CBD), which is a convex polygon of \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e points.\u003c/p\u003e\n \u003cp\u003eAssuming the pick-up and drop-off points from the passengers\n are chosen, uniformly at random, from inside the CBD, what is\n the expected distance that a taxi will travel? Assume the taxi\n travel distance between any points \u003cspan class\u003d\"tex2jax_process\"\u003e$(x, y)$\u003c/span\u003e and \u003cspan class\u003d\"tex2jax_process\"\u003e$(x_1, y_1)$\u003c/span\u003e is always \u003cspan class\u003d\"tex2jax_process\"\u003e$|x-x_1|+|y-y_1|$\u003c/span\u003e.\u003c/p\u003e\n \u003ch2\u003eInput\u003c/h2\u003e\n \u003cp\u003eThe first line contains an integer \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e (\u003cspan class\u003d\"tex2jax_process\"\u003e$3\n \\le n \\le 100\\, 000$\u003c/span\u003e).\u003c/p\u003e\n \u003cp\u003eFollowing this will be \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e lines, each with two integer\n values values (\u003cspan class\u003d\"tex2jax_process\"\u003e$x, y$\u003c/span\u003e)\n representing the points on the border of CBD, where\n \u003cspan class\u003d\"tex2jax_process\"\u003e$|x|,|y| \u0026lt; 10^9$\u003c/span\u003e. The\n points are presented in a clockwise order and there will be no\n three points on the same line.\u003c/p\u003e\n \u003ch2\u003eOutput\u003c/h2\u003e\n \u003cp\u003eThe output is a single line containing one number, the\n expected distance expressed with a relative or absolute error\n less than \u003cspan class\u003d\"tex2jax_process\"\u003e$10^{-6}$\u003c/span\u003e.\u003c/p\u003e\n \u003ch2\u003eSample 1\u003c/h2\u003e\u003cbody\u003e\u003ctable class\u003d\"vjudge_sample\"\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\n0 0\n0 1\n1 1\n1 0\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0.666666666666667\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/body\u003e\n \u003ch2\u003eSample 2\u003c/h2\u003e\u003cbody\u003e\u003ctable class\u003d\"vjudge_sample\"\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\u003e3\n0 0\n1 1\n2 0\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0.733333333333333\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/body\u003e\n \u003ch2\u003eSample 3\u003c/h2\u003e\u003cbody\u003e\u003ctable class\u003d\"vjudge_sample\"\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\u003e6\n0 0\n1 1\n3 2\n5 1\n4 -1\n2 -1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2.08448753462604\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/body\u003e\n "}}]}