{"trustable":true,"prependHtml":"\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\" /\u003e\n\u003cscript\u003e\n window.katexOptions \u003d { disable: true };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003eLong long ago, there is a famous farmer named John. He owns a big farm and many cows. There are two kinds of cows on his farm, one is Friesian, and another one is Ayrshire. Each cow has its own territory. In detail, the territory of Friesian is a circle, and of Ayrshire is a triangle. It is obvious that each cow doesn\u0027t want their territory violated by others, so the territories won\u0027t intersect.\u003cbr\u003e\u003cbr\u003eSince the winter is falling, FJ has to build a fence to protect all his cows from hungry wolves, making the territory of cows in the fence. Due to the financial crisis, FJ is currently lack of money, he wants the total length of the fence minimized. So he comes to you, the greatest programmer ever for help. Please note that the part of fence don\u0027t have to be a straight line, it can be a curve if necessary. \u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The input contains several test cases, terminated by EOF. The number of test cases does not exceed 20.\u003cbr\u003eEach test case begins with two integers N and M(0 ≤ N, M ≤ 50, N + M \u0026gt; 0)which denotes the number of the Friesian and Ayrshire respectively. Then follows N + M lines, each line representing the territory of the cow. Each of the first N lines contains three integers X\u003csub\u003ei\u003c/sub\u003e, Y\u003csub\u003ei\u003c/sub\u003e, R\u003csub\u003ei\u003c/sub\u003e(1 ≤ R\u003csub\u003ei\u003c/sub\u003e ≤ 500),denotes the coordinates of the circle\u0027s centre and radius. Then each of the remaining M lines contains six integers X1\u003csub\u003ei\u003c/sub\u003e, Y1\u003csub\u003ei\u003c/sub\u003e, X2\u003csub\u003ei\u003c/sub\u003e, Y2\u003csub\u003ei\u003c/sub\u003e, X3\u003csub\u003ei\u003c/sub\u003e, Y3\u003csub\u003ei\u003c/sub\u003e, denotes the coordinates of the triangle vertices. The absolute value of the coordinates won\u0027t exceed 10000. "}},{"title":"Output","value":{"format":"HTML","content":"For each test case, print a single line containing the minimal fence length. Your output should have an absolute error of at most 1e-3. "}},{"title":"Sample","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\u003e1 1\r\n4 4 1\r\n0 0 0 2 2 0\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e15.66692\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Hint","value":{"format":"HTML","content":"\u003cbr\u003ePlease see the sample picture for more details, the fence is highlighted with red.\u003cbr\u003e\u003ccenter\u003e\u003cimg style\u003d\"max-width:100%;\" src\u003d\"CDN_BASE_URL/76257b64ce6638e68565a7f93554b327?v\u003d1713364194\"\u003e\u003c/center\u003e \u003cbr\u003e"}}]}