{"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\u003eProf. Du and Prof. Pang plan to build a sky garden near the city of Allin. In the garden, there will be a plant maze consisting of straight and circular roads.\u003c/p\u003e\u003cp\u003eOn the blueprint of the plant maze, Prof. Du draws $$$n$$$ circles indicating the circular roads. All of them have center $$$(0, 0)$$$. The radius of the $$$i$$$-th circle is $$$i$$$.\u003c/p\u003e\u003cp\u003eMeanwhile, Prof. Pang draws $$$m$$$ lines on the blueprint indicating the straight roads. All of the lines pass through $$$(0, 0)$$$. Each circle is divided into $$$2m$$$ parts with equal lengths by these lines.\u003c/p\u003e\u003cp\u003eLet $$$Q$$$ be the set of the $$$n+m$$$ roads. Let $$$P$$$ be the set of all intersections of two different roads in $$$Q$$$. Note that each circular road and each straight road have two intersections.\u003c/p\u003e\u003cp\u003eFor two different points $$$a\\in P$$$ and $$$b\\in P$$$, we define $$$dis(\\{a, b\\})$$$ to be the shortest distance one needs to walk from $$$a$$$ to $$$b$$$ along the roads. Please calculate the sum of $$$dis(\\{a, b\\})$$$ for all $$$\\{a, b\\}\\subseteq P$$$. \u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe only line contains two integers $$$n,m~(1\\le n,m\\le 500)$$$.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eOutput one number – the sum of the distances between every pair of points in $$$P$$$.\u003c/p\u003e\u003cp\u003eYour answer is 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\u003e1 2\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e14.2831853072\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","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\u003e2 3\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e175.4159265359\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003e\u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/1fbf94cc38206f634d9c6e3706a9c5a1?v\u003d1726217641\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\" width\u003d\"189px\"\u003e\u003c/p\u003e\u003cp\u003e$$$dis(p_1, p_2)\u003ddis(p_2, p_3)\u003ddis(p_3, p_4)\u003ddis(p_1, p_4)\u003d\\frac{\\pi}{2}$$$\u003c/p\u003e\u003cp\u003e$$$dis(p_1, p_5)\u003ddis(p_2, p_5)\u003ddis(p_3, p_5)\u003ddis(p_4, p_5)\u003d1$$$\u003c/p\u003e\u003cp\u003e$$$dis(p_1, p_3)\u003ddis(p_2, p_4)\u003d2$$$\u003c/p\u003e"}}]}