{"raw_statement":[{"iden":"statement","content":"Let d be the diameter of a circle with center c = (a, b). A square has been drawn inside that circle such that its vertices lies at the circle's circumference. Four circles have been drawn on the square's sides such that the diameter of each circle is the side of the square, as shown in the figure below.\n\nYour task is to calculate the shaded area in the figure for a given d. Can you?\n\nThe first line contains an integer T (1 ≤ T ≤ 105), in which T is the number of test cases.\n\nEach test case consists of a line containing an three integers a, b, and d ( - 109 ≤ a, b ≤ 109) (1 ≤ d ≤ 109), giving the center and the diameter of a circle.\n\nFor each test case, print a single line containing shaded area.\n\nYour answer will be considered correct if its absolute or relative error does not exceed 10 - 6.\n\n"},{"iden":"input","content":"The first line contains an integer T (1 ≤ T ≤ 105), in which T is the number of test cases.Each test case consists of a line containing an three integers a, b, and d ( - 109 ≤ a, b ≤ 109) (1 ≤ d ≤ 109), giving the center and the diameter of a circle."},{"iden":"output","content":"For each test case, print a single line containing shaded area.Your answer will be considered correct if its absolute or relative error does not exceed 10 - 6."}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ T \\in \\mathbb{Z} $ be the number of test cases.  \nFor each test case, let $ d \\in \\mathbb{R}^+ $ be the diameter of a circle centered at $ (a, b) \\in \\mathbb{R}^2 $.  \nA square is inscribed in the circle such that its vertices lie on the circumference.  \nFour semicircles are drawn outwardly on each side of the square, with each side as diameter.  \n\n**Constraints**  \n1. $ 1 \\leq T \\leq 10^5 $  \n2. $ -10^9 \\leq a, b \\leq 10^9 $  \n3. $ 1 \\leq d \\leq 10^9 $  \n\n**Objective**  \nCompute the shaded area, defined as the area of the four semicircles minus the area of the inscribed square.  \n\nLet $ s $ be the side length of the square. Since the square is inscribed in a circle of diameter $ d $, the diagonal of the square equals $ d $:  \n$$\ns\\sqrt{2} = d \\quad \\Rightarrow \\quad s = \\frac{d}{\\sqrt{2}}\n$$\n\nArea of the square:  \n$$\nA_{\\text{square}} = s^2 = \\frac{d^2}{2}\n$$\n\nEach semicircle has diameter $ s $, so radius $ r = \\frac{s}{2} = \\frac{d}{2\\sqrt{2}} $.  \nArea of one semicircle:  \n$$\n\\frac{1}{2} \\pi r^2 = \\frac{1}{2} \\pi \\left( \\frac{d}{2\\sqrt{2}} \\right)^2 = \\frac{1}{2} \\pi \\cdot \\frac{d^2}{8} = \\frac{\\pi d^2}{16}\n$$\n\nTotal area of four semicircles:  \n$$\n4 \\cdot \\frac{\\pi d^2}{16} = \\frac{\\pi d^2}{4}\n$$\n\nShaded area:  \n$$\nA_{\\text{shaded}} = \\frac{\\pi d^2}{4} - \\frac{d^2}{2} = d^2 \\left( \\frac{\\pi}{4} - \\frac{1}{2} \\right)\n$$\n\n**Output**  \nFor each test case, output:  \n$$\nd^2 \\left( \\frac{\\pi}{4} - \\frac{1}{2} \\right)\n$$","simple_statement":"You are given three convex walls: Wall Sheena (inner), Wall Rose (middle), and Wall Maria (outer).  \nEach wall is defined by its vertices in counter-clockwise order.  \n\nYou are also given n equipment positions.  \nFor each equipment, determine which region it lies in:  \n- Inside Wall Sheena → print \"Sheena\"  \n- Between Wall Sheena and Wall Rose → print \"Rose\"  \n- Between Wall Rose and Wall Maria → print \"Maria\"  \n- Outside Wall Maria → print \"Outside\"  \n\nPoints on a wall are considered inside that wall.  \nWalls are strictly nested: Sheena ⊂ Rose ⊂ Maria.","has_page_source":false}