{"problem":{"name":"I. Circles","description":{"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 squa","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10185I"},"statements":[{"statement_type":"Markdown","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## Input\n\nThe 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.\n\n## Output\n\nFor 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.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**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$$","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10185I","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}