{"trustable":false,"sections":[{"title":"","value":{"format":"PLAIN","content":"Programming contests became so popular in the year 2397 that the governor of New Earck | the largest human-inhabited planet of the galaxy | opened a special Alley of Contestant Memories (ACM)at the local graveyard. The ACM encircles a green park, and holds the holographic statues of famous contestants placed equidistantly along the park perimeter. The alley has to be renewed from time to time when a new group of memorials arrives.\n\nWhen new memorials are added, the exact place for each can be selected arbitrarily along the ACM,but the equidistant disposition must be maintained by moving some of the old statues along the alley.\n\nSurprisingly, humans are still quite superstitious in 24th century: the graveyard keepers believe the holograms are holding dead people souls, and thus always try to renew the ACM with minimal possible movements of existing statues (besides, the holographic equipment is very heavy). Statues are moved along the park perimeter. Your work is to find a renewal plan which minimizes the sum of travel distances of all statues. Installation of a new hologram adds no distance penalty, so choose the places for newcomers wisely!\n\n在2397年,编程比赛变得如此流行,以至于新厄尔克(New Earck)这个银河系最大的人类居住星球的总督在当地的墓地开辟了一条特殊的参赛者记忆小巷(ACM)。ACM环绕着一个绿色的公园,公园周边等距放置着著名选手的全息雕像。当新的一批纪念物到来时,这条巷子要不时地更新。\n\n当新的纪念碑加入时,每个纪念碑的具体位置可以沿ACM任意选择,但必须将一些旧的雕像沿巷子移动,以保持等距排列。\n\n令人惊讶的是,在24世纪,人类仍然相当迷信:墓地管理员相信全息图像承载着死者的灵魂,因此总是尽量减少现有雕像的移动,以更新ACM(此外,全息设备非常沉重)。雕像是沿着公园周边移动的。你的工作是找到一个更新计划,使所有雕像的移动距离之和最小化。安装一个新的全息图像不会增加距离惩罚,所以要明智地选择新来的地方!"}},{"title":"Input","value":{"format":"PLAIN","content":"The input file contains several test cases, each of them consists of a a line that contains two integer numbers:n| the number of holographic statues initially located at the ACM, and m| the number of statues to be added (2\u003c\u003dn\u003c\u003d1000, 1\u003c\u003dm\u003c\u003d1000). The length of the alley along the park perimeteris exactly 10 000 feet.\n\n输入文件包含几个测试用例,每个测试用例都由一行包含两个整数:n|最初位于ACM的全息雕像数量,m|将要添加的雕像数量(2\u003c\u003dn\u003c\u003d1000,1\u003c\u003dm\u003c\u003d1000)。沿公园周边的小巷长度正好是10 000英尺。\n"}},{"title":"Output","value":{"format":"PLAIN","content":"For each test case, write to the output a line with a single real number | the minimal sum of travel distances of all statues (in feet). The answer must be precise to at least 4 digits after decimal point.Note:Pictures show the first three examples. Marked circles denote original statues, empty circles denote new equidistant places, arrows denote movement plans for existing statues.\n\n对于每一个测试案例,在输出中写下一行实数|所有雕像的最小移动距离之和(以英尺为单位),答案必须精确到小数点后至少4位。答案必须精确到小数点后的至少4位数。注:图片为前三个例子,标有圆圈的为原雕像,空圈的为新等距离的地方,箭头的为现有雕像的移动计划。"}},{"title":"Sample Input","value":{"format":"PLAIN","content":"2 1\n2 3\n3 1\n10 10"}},{"title":"Sample Output","value":{"format":"PLAIN","content":"1666.6667\n1000.0\n1666.6667\n0.0\n"}}]}