{"trustable":false,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cscript type\u003d\u0027text/x-mathjax-config\u0027\u003eMathJax.Hub.Config({tex2jax: { inlineMath: [[\u0027$\u0027,\u0027$\u0027]] } }); \u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027 src\u003d\u0027https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\u0027\u003e\u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027\u003esetTimeout(function(){MathJax.Hub.Queue([\u0027Typeset\u0027, MathJax.Hub, \u0027left_view\u0027]);}, 2000);\u003c/script\u003e\n\u003cdiv class\u003d\"panel_content\"\u003e\n Finally, the winter holiday, Xiaoming and his girlfriend to go to the movies. This day, his girlfriend wants to give Xiaoming a test, when Xiaoming is ready to go, his girlfriend told him that she is waiting for him in the cinema, Xiaoming over the route must meet the given rules:\n \u003cbr\u003e 1. Assuming that Xiaoming is in the position of the 1st point and his girlfriend is in the position of the n-th point, there are n - 2 points between them that he can pass through, Xiaoming can only go to the position of a point with larger number than the current one he is standing. \n \u003cbr\u003e 2. When Xiaoming, he could not pass through certain places in a certain order. For example, if the girlfriend told Xiaoming that he can not go through 1- \u0026gt; 2- \u0026gt; 3, then it requires Xiaoming to walk through a path that doesn\u0027t contain 1- \u0026gt; 2- \u0026gt; 3 as subpath, but 1- \u0026gt; 3 or 1- \u0026gt; 2 are possible, such a restriction path may have multiple paths.\n \u003cbr\u003e This makes Xiaoming to have a headache, now he gave you the problem to solve it for him. \n \u003cbr\u003e If the path 1- \u0026gt; 2- \u0026gt; 3 is such that 1, 2 and 3 are collinear, but Xiaoming goes from 1 to 3, even if he passed through the coordinates of the point 2, it isn\u0027t counted. \n \u003cbr\u003e Now, Xiaoming wants to go the shortest way to see his girlfriend as soon as possible, and do not want to break the rules of his girlfriend, can you help Xiaoming solve this problem?\n\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":" The input contains multiple sets of samples, each set of samples first contains two integers n and m, where n represents n points, Xiaoming is at the 1st point and his girlfriend is at the nth point,m represents Xiaoming\u0027s girlfriend has m requirements; \n\u003cbr\u003e The next n rows enter 2 real numbers x and y per row, representing the position of these n points (the number of points is from 1 to n); \n\u003cbr\u003e Then, m requirements follow, each requirement is described in 2 lines. The first line is an integer k, indicating that the requirements has k points, and then the order of the points, which means that Xiaoming can\u0027t go through the points k1 -\u0026gt; k2 -\u0026gt; k3......- \u0026gt; ki in this order;\n\u003cbr\u003e when n and m are equal to 0, the input ends. \n\u003cbr\u003e \n\u003cbr\u003e \u003cb\u003e[Technical Specification]\u003c/b\u003e \n\u003cbr\u003e 2 \u0026lt;\u003d n \u0026lt;\u003d 50 \n\u003cbr\u003e 1 \u0026lt;\u003d m \u0026lt;\u003d 100 \n\u003cbr\u003e 2 \u0026lt;\u003d k \u0026lt;\u003d 5 \n\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":" For each case, if there is a shortest path that meets the requirements, please print this shortest path with a precision of two decimal places; otherwise, please print \"Can not be reached!\" (Without the quotes)."}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e3 1\n1 1\n2 1\n3 1\n2\n1 2\n\n2 1\n0 0\n1 1\n2 \n1 2\n\n5 3\n0 0\n5 3\n1 2\n1 22\n5 21\n3\n1 2 3\n2 \n4 5\n2\n1 5\n\n0 0\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e2.00\nCan not be reached!\n21.65\u003c/pre\u003e"}}]}