{"problem":{"name":"I. Farm","description":{"content":"Saleem is a farmer. He has orange trees in his farm. The orange trees need a lot of water but this year there is not enough rain falls. Fortunately there is a well, but not all of this well is inside ","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":2000,"memory_limit":65536},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10093I"},"statements":[{"statement_type":"Markdown","content":"Saleem is a farmer. He has orange trees in his farm. The orange trees need a lot of water but this year there is not enough rain falls. Fortunately there is a well, but not all of this well is inside his farm.  Saleem wants to make a deal with his neighbors. Everyone can take one gallon of water for every square meter of the well area inside his farm.  you should help Saleem to know how many gallon of water he can take. If you know that: \n\n  - The farm is rectangle. \n\n  - The well is circle. \n\n  - The upper-left corner of his farm is inside the well. \n\n  - The width and the height of the farm are bigger than Diameter (2R) of the well. \n\n \n\nYour program will be tested on one or more test cases. The first line of the input will be a single integer T, the number of test cases (1  ≤  T  ≤  10000). Followed by the test cases, each test case is on two lines. the first line consists of three integers -1000  ≤  Xc,Yc,R  ≤  1000 where (Xc,Yc) is the center of well and R is the radius. the second line consists of four integers -1000  ≤  Xb,Yb,Xu,Yu  ≤  1000 where (Xb,Yb) is the bottom-left corner and (Xu,Yu) is the upper-right corner.\n\nFor each test case print a line is the following format: \"Case c: x\" where c is the test case number starting from 1 and x is the amount of water rounded to 5 decimal places.\n\n## Input\n\nYour program will be tested on one or more test cases. The first line of the input will be a single integer T, the number of test cases (1  ≤  T  ≤  10000). Followed by the test cases, each test case is on two lines. the first line consists of three integers -1000  ≤  Xc,Yc,R  ≤  1000 where (Xc,Yc) is the center of well and R is the radius. the second line consists of four integers -1000  ≤  Xb,Yb,Xu,Yu  ≤  1000 where (Xb,Yb) is the bottom-left corner and (Xu,Yu) is the upper-right corner.\n\n## Output\n\nFor each test case print a line is the following format: \"Case c: x\" where c is the test case number starting from 1 and x is the amount of water rounded to 5 decimal places.\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 $ (X_c, Y_c) \\in \\mathbb{R}^2 $ be the center of a circular well with radius $ R \\in \\mathbb{R}^+ $.  \n- Let the rectangular farm be defined by bottom-left corner $ (X_b, Y_b) $ and upper-right corner $ (X_u, Y_u) $, so its area is $ [X_b, X_u] \\times [Y_b, Y_u] $.  \n\n**Constraints**  \n1. $ 1 \\leq T \\leq 10000 $  \n2. $ -1000 \\leq X_c, Y_c, R \\leq 1000 $, $ R > 0 $  \n3. $ -1000 \\leq X_b, Y_b, X_u, Y_u \\leq 1000 $, $ X_b < X_u $, $ Y_b < Y_u $  \n4. The upper-left corner $ (X_b, Y_u) $ lies inside the well: $ (X_b - X_c)^2 + (Y_u - Y_c)^2 \\leq R^2 $  \n5. $ X_u - X_b > 2R $ and $ Y_u - Y_b > 2R $  \n\n**Objective**  \nFor each test case, compute the area of intersection between the circle centered at $ (X_c, Y_c) $ with radius $ R $ and the rectangle $ [X_b, X_u] \\times [Y_b, Y_u] $.  \nOutput this area (in gallons) rounded to 5 decimal places.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10093I","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}