J. Lazy Physics Cat

Codeforces
IDCF10135J
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
Physics cat likes to draw shapes and figure out their area. He starts by drawing a circle. Then inside the circle, he draws the triangle X, Y, Z - where Y is the center point of the circle, and X and Z touch the circumference of the circle. Please note that points X and Y always have the same x-coordinate. Given L (the distance between Points X and Y) and A (the angle XYZ in degrees); help physics cat find the shaded area between the right side of the triangle and the circumference of the circle. And when we say help, we mean do all the work for him. The first line of input is T – the number of test cases. The first line of each test case is integers L and A (1 ≤ L ≤ 1000) (1 ≤ A ≤ 180). For each test case, output on a line the area of the shaded region rounded to 6 decimal places. ## Input The first line of input is T – the number of test cases.The first line of each test case is integers L and A (1 ≤ L ≤ 1000) (1 ≤ A ≤ 180). ## Output For each test case, output on a line the area of the shaded region rounded to 6 decimal places. [samples]
**Definitions** Let $ T \in \mathbb{Z} $ be the number of test cases. For each test case $ k \in \{1, \dots, T\} $: - Let $ L \in \mathbb{R}^+ $ be the length of segment $ XY $, where $ Y $ is the center of the circle and $ X $ lies on the vertical diameter. - Let $ A \in \mathbb{R} $ be the angle $ \angle XYZ $ in degrees, where $ Z $ lies on the circumference and $ XY = YZ = r $ (radius of the circle). **Constraints** 1. $ 1 \leq T \leq 1000 $ 2. $ 1 \leq L \leq 1000 $ 3. $ 1 \leq A \leq 180 $ **Objective** Given that $ XY = L $ and $ \angle XYZ = A^\circ $, and since $ Y $ is the center and $ X, Z $ lie on the circle, the radius is $ r = L $. The shaded region is the area between the right side of triangle $ XYZ $ and the circle’s circumference — specifically, the circular segment corresponding to central angle $ A^\circ $ on the right half of the circle. Compute the area of the circular segment: $$ \text{Shaded Area} = \frac{A}{360} \cdot \pi r^2 - \frac{1}{2} r^2 \sin\left(\frac{A \pi}{180}\right) $$ with $ r = L $. Output the result rounded to 6 decimal places for each test case.
API Response (JSON)
{
  "problem": {
    "name": "J. Lazy Physics Cat",
    "description": {
      "content": "Physics cat likes to draw shapes and figure out their area. He starts by drawing a circle. Then inside the circle, he draws the triangle X, Y, Z - where Y is the center point of the circle, and X and ",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10135J"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Physics cat likes to draw shapes and figure out their area. He starts by drawing a circle. Then inside the circle, he draws the triangle X, Y, Z - where Y is the center point of the circle, and X and ...",
      "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 $ L \\in \\mathbb{R}^+ $ be the length of segment $ XY $, where $ Y $ is t...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments