{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eWowo is a solo adventurer who completed many dangerous journeys on his own foot in forests, deserts and even glaciers. The Shanghai ICPC (Shanghai Invitational Contest on Programmable Cheating) committee invited Wowo as a tester of their new running trial.\u003c/p\u003e\u003cp\u003eThe trial can be described as a 2D simple polyline $$$(p_1,\\ldots, p_n)$$$. In other words, the trial consists of $$$n-1$$$ line segments $$$(p_1, p_2),\\ldots, (p_{n-1}, p_n)$$$. The line segments do not intersect with each other except that two consecutive line segments $$$(p_i, p_{i+1})$$$ and $$$(p_{i+1}, p_{i+2})$$$ intersect at the point $$$p_{i+1}$$$. Any two consecutive segments have different directions. The committee wants Wowo to run from $$$p_1$$$ to $$$p_n$$$ along the line segments $$$(p_1,p_2),\\ldots, (p_{n-1}, p_n)$$$ in order.\u003c/p\u003e\u003cp\u003eHowever, Wowo has a smart device that can hack the committee\u0027s system for an interval of time. Wowo is able to choose $$$2$$$ points $$$a, b$$$ on the trial and run directly from $$$a$$$ to $$$b$$$ along the line segment $$$(a, b)$$$. Each of these $$$a$$$ and $$$b$$$ can be some $$$p_i$$$ ($$$1\\le i\\le n$$$) and can be some point on some line segment $$$(p_i, p_{i+1})$$$ ($$$1\\le i\u0026lt;n$$$) as well. Before reaching $$$a$$$ and after reaching $$$b$$$, Wowo has to run along the original trial. Wowo does not want to be caught cheating, so he decided that the line segment $$$(a, b)$$$ should not intersect or touch any line segment of the trial at any point other than $$$a$$$ and $$$b$$$. Help Wowo to choose $$$a$$$ and $$$b$$$ wisely and output the shortest distance Wowo need to run from $$$p_1$$$ to $$$p_n$$$ using his smart cheating device.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line includes a single integer $$$n$$$ indicating the number of points on the running trial ($$$2\\le n\\le 200$$$).\u003c/p\u003e\u003cp\u003eThe $$$i+1$$$-th line ($$$1\\le i\\le n$$$) contains two integers $$$x$$$ and $$$y$$$ separated by a single space indicating the coordinates of $$$p_i$$$ ($$$-1000\\le x, y\\le 1000$$$).\u003c/p\u003e\u003cp\u003eIt is guaranteed that the line segments do not intersect with each other except that two consecutive line segments $$$(p_i, p_{i+1})$$$ and $$$(p_{i+1}, p_{i+2})$$$ intersect at the point $$$p_{i+1}$$$. In other words, $$$(p_i, p_{i+1})\\cap (p_{j}, p_{j+1})\u003d\\left\\{\\begin{array}{cc}\\emptyset \u0026amp; i\\neq j-1\\\\ \\{p_{j}\\} \u0026amp; i \u003d j-1\\end{array}\\right.$$$ holds for any integers $$$i, j$$$ satisfying $$$1\\le i\u0026lt; j\u0026lt;n$$$. Here $$$(s, t)$$$ represents all points on the line segment from $$$s$$$ to $$$t$$$ including $$$s$$$ and $$$t$$$.\u003c/p\u003e\u003cp\u003eIt is guaranteed that each line segment has nonzero length. In other words, $$$p_i\\neq p_{i+1}$$$ for any integer $$$i\\in [1, n)$$$.\u003c/p\u003e\u003cp\u003eIt is guaranteed that adjacent line segments are not collinear. In other words, for any integer $$$i\\in [1,n-2]$$$ and any real number $$$\\lambda$$$, $$$p_i - p_{i+1}$$$ is \u003cspan class\u003d\"tex-font-style-bf\"\u003enot\u003c/span\u003e equal to $$$\\lambda(p_{i+1}-p_{i+2})$$$.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eOutput the shortest distance Wowo needs to run. Your answer will be considered correct if its absolute or relative error does not exceed $$$10^{-6}$$$.\u003c/p\u003e"}},{"title":"Examples","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\u003e5\n0 0\n1 10\n2 0\n3 10\n4 0\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e22.099751242242\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}