{"problem":{"name":"K. Wolf and sheep","description":{"content":"A sheep lives on an infinite field. The sheep wants to eat some grass. Grass only exists in one place. That place is a circle defined by a center point (Gx, Gy) and a radius Gr. The sheep would gladl","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10049K"},"statements":[{"statement_type":"Markdown","content":"A sheep lives on an infinite field. The sheep wants to eat some grass. Grass only exists in one place. That place is a circle defined by a center point (Gx, Gy) and a radius Gr.\n\nThe sheep would gladly eat all the grass. But if you read the title of this task you noticed that there is also a wolf on that field. The wolf wants to eat the sheep, but we don't want that to happen.\n\nThe wolf is tied to a pole at position (Wx, Wy) with a rope of length Wr.\n\nFind the area of grass that the sheep can eat without being eaten by the wolf. We can assume that the sheep starts in a safe location.\n\nThe first line contains the number of test cases T (1 ≤ T ≤ 10000). \n\nEach test case consists of 2 lines. The first line contains integers Gx, Gy and Gr. The second line contains integers Wx, Wy and Wr. ( - 105 ≤ Gx, Gy, Wx, Wy ≤ 105, 1 ≤ Gr, Wr ≤ 105)\n\nFor each test case output one line containing “_Case #tc: A_”, where tc is the number of the test case (starting from 1) and A is the area of grass that the sheep can eat safely with a maximum absolute or relative error of *10 - 6*.\n\n## Input\n\nThe first line contains the number of test cases T (1 ≤ T ≤ 10000). Each test case consists of 2 lines. The first line contains integers Gx, Gy and Gr. The second line contains integers Wx, Wy and Wr. ( - 105 ≤ Gx, Gy, Wx, Wy ≤ 105, 1 ≤ Gr, Wr ≤ 105)\n\n## Output\n\nFor each test case output one line containing “_Case #tc: A_”, where tc is the number of the test case (starting from 1) and A is the area of grass that the sheep can eat safely with a maximum absolute or relative error of *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 $ k \\in \\{1, \\dots, T\\} $:  \n- Let $ C_G = (G_x, G_y) \\in \\mathbb{R}^2 $ be the center of the grass circle with radius $ G_r \\in \\mathbb{R}^+ $.  \n- Let $ C_W = (W_x, W_y) \\in \\mathbb{R}^2 $ be the center of the wolf's reach circle with radius $ W_r \\in \\mathbb{R}^+ $.  \n\n**Constraints**  \n1. $ 1 \\le T \\le 10000 $  \n2. $ -10^5 \\le G_x, G_y, W_x, W_y \\le 10^5 $  \n3. $ 1 \\le G_r, W_r \\le 10^5 $  \n\n**Objective**  \nFor each test case $ k $, compute the area of the grass circle $ C_G $ that lies outside the wolf's reach circle $ C_W $:  \n$$\nA_k = \\text{Area}(C_G \\setminus C_W)\n$$  \nThat is, the area of the disk centered at $ C_G $ with radius $ G_r $, minus the area of its intersection with the disk centered at $ C_W $ with radius $ W_r $.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10049K","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}