{"raw_statement":[{"iden":"problem statement","content":"There is a town represented as an $xy$\\-plane, where Santa lives, along with $N$ children numbered $1$ to $N$. Santa's house is at coordinates $(S_X,S_Y)$, and the house of child $i\\ (1\\leq i\\leq N)$ is at $(X_i,Y_i)$.\nSanta wants to deliver one present to each of the $N$ children **in numerical order**. To deliver a present to child $i$, Santa must visit the house of child $i$ with at least one present in hand. However, Santa can only carry up to $K$ presents at a time, and he must return to his own house to replenish presents (there are enough presents at Santa's house).\nFind the minimum distance Santa must travel to leave his house, deliver presents to all $N$ children, and return to his house."},{"iden":"constraints","content":"*   $1\\leq K\\leq N \\leq 2\\times 10^5$\n*   $-10^9\\leq S_X,S_Y,X_i,Y_i \\leq 10^9$\n*   $(S_X,S_Y)\\neq (X_i,Y_i)$\n*   $(X_i,Y_i)\\neq (X_j,Y_j)\\ (i\\neq j)$\n*   All input values are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$ $K$\n$S_X$ $S_Y$\n$X_1$ $Y_1$\n$X_2$ $Y_2$\n$\\vdots$\n$X_N$ $Y_N$"},{"iden":"sample input 1","content":"3 2\n1 1\n3 1\n1 2\n3 2"},{"iden":"sample output 1","content":"9.236067977499790\n\n![image](https://img.atcoder.jp/abc334/3c258c2a4866ff2c01dbcdbdfebb4111.png)\nIn the figure above, the red circle represents Santa's house, and the circles with numbers represent the houses of the children with those numbers.\nConsider Santa acting as follows:\n\n1.  Leave his house with two presents.\n2.  Go to child $1$'s house and deliver a present.\n3.  Return to his house and replenish one present.\n4.  Go to child $2$'s house and deliver a present.\n5.  Go to child $3$'s house and deliver a present.\n6.  Return to his house.\n\nIn this case, Santa travels the distance of $2+2+1+2+\\sqrt{5}=7+\\sqrt{5}=9.236\\dots$, which is the minimum."},{"iden":"sample input 2","content":"2 1\n0 1\n-1 1\n1 1"},{"iden":"sample output 2","content":"4.000000000000000"},{"iden":"sample input 3","content":"8 3\n735867677 193944314\n586260100 -192321079\n95834122 802780784\n418379342 -790013317\n-445130206 189801569\n-354684803 -49687658\n-204491568 -840249197\n853829789 470958158\n-751917965 762048217"},{"iden":"sample output 3","content":"11347715738.116592407226562"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}