I. Irregular Shape of Orz Pandas

Codeforces
IDCF10287I
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
Some Orz Pandas are watching Master Ma's video and laughing. Master Ma is a famous combat trainer. In the video he is presenting his signature move, _the Five Continous Whips of Lightning_. He has sketched the move on a blackboard. The shape of the sketch is very irregular but can be approximated as a polygon. Master Ma believes the power of _the Five Continous Whips of Lighting_ is proportional to the area of this polygon. While the Orz Pandas are laughing, they also want to know the value of this area. There are multiple test cases. Please process until EOF. For each test case, the first line contains one integer $n$, the number of vertices of the polygon. The $i$-th of the next $n$ lines contains two integers $x_i$ and $y_i$, the Cartesian coordinates of the $i$-th vertex. The $i$-th edge of the polygon is the segment connecting the $i$-th vertex and the $(i + 1)$-th vertex. The $n$-th edge is the segment connecting the $n$-th and the first vertex. It's guaranteed that $3 <= n <= 10^3$, $-10^9 <= x_i, y_i <= 10^9$, and the sum of $n$ of all test cases in the input file will not exceed $10^4$. Since Master Ma's move is too irregular, the polygon may be *non*-convex. But it's guaranteed that the polygon is simple: each line segment endpoint is shared by exactly two segments, and the segments do not otherwise intersect. It's also guaranteed that all vertices are unique. For each test case output one line containing the area of the polygon. The area should be rounded up to exactly two decimal places after the point. This problem is *not* special judged. To reduce the number of "_Wrong Answer_", the Orz Pandas added several additional examples. Use them wisely. ## Input There are multiple test cases. Please process until EOF.For each test case, the first line contains one integer $n$, the number of vertices of the polygon. The $i$-th of the next $n$ lines contains two integers $x_i$ and $y_i$, the Cartesian coordinates of the $i$-th vertex.The $i$-th edge of the polygon is the segment connecting the $i$-th vertex and the $(i + 1)$-th vertex. The $n$-th edge is the segment connecting the $n$-th and the first vertex.It's guaranteed that $3 <= n <= 10^3$, $-10^9 <= x_i, y_i <= 10^9$, and the sum of $n$ of all test cases in the input file will not exceed $10^4$.Since Master Ma's move is too irregular, the polygon may be *non*-convex. But it's guaranteed that the polygon is simple: each line segment endpoint is shared by exactly two segments, and the segments do not otherwise intersect. It's also guaranteed that all vertices are unique. ## Output For each test case output one line containing the area of the polygon. The area should be rounded up to exactly two decimal places after the point.This problem is *not* special judged. [samples] ## Note To reduce the number of "_Wrong Answer_", the Orz Pandas added several additional examples. Use them wisely.
**Definitions** Let $ n, m \in \mathbb{Z}^+ $ denote the number of rows and columns of intersections. Let $ (x_s, y_s), (x_t, y_t) \in \{1, \dots, n\} \times \{1, \dots, m\} $ be the start and target intersections. For each intersection $ (i, j) $: - $ a_{i,j}, b_{i,j} \in \mathbb{Z}^+ $ are given properties. - For $ 1 \le i \le n $, $ 1 \le j < m $: $ c_{i,j} \in \mathbb{Z}^+ $ is the time to traverse horizontally from $ (i,j) $ to $ (i,j+1) $. - For $ 1 \le i < n $, $ 1 \le j \le m $: $ w_{i,j} \in \mathbb{Z}^+ $ is the time to traverse vertically from $ (i,j) $ to $ (i+1,j) $. **Constraints** 1. $ 2 \le n, m \le 500 $ 2. $ 1 \le x_s, x_t \le n $, $ 1 \le y_s, y_t \le m $ 3. $ 1 \le a_{i,j}, b_{i,j}, c_{i,j}, w_{i,j} \le 10^9 $ **Objective** Find the minimum time to travel from $ (x_s, y_s) $ to $ (x_t, y_t) $, where movement is allowed only between adjacent intersections (up/down/left/right) with traversal times $ c_{i,j} $ (horizontal) and $ w_{i,j} $ (vertical), and no time is spent at intersections. **Note**: The properties $ a_{i,j} $ and $ b_{i,j} $ are **not used** in the movement cost model as described — they are extraneous to the stated transition rules. The problem reduces to a shortest path on a grid with weighted edges.
API Response (JSON)
{
  "problem": {
    "name": "I. Irregular Shape of Orz Pandas",
    "description": {
      "content": "Some Orz Pandas are watching Master Ma's video and laughing. Master Ma is a famous combat trainer. In the video he is presenting his signature move, _the Five Continous Whips of Lightning_. He has ske",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10287I"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Some Orz Pandas are watching Master Ma's video and laughing. Master Ma is a famous combat trainer. In the video he is presenting his signature move, _the Five Continous Whips of Lightning_. He has ske...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ n, m \\in \\mathbb{Z}^+ $ denote the number of rows and columns of intersections.  \nLet $ (x_s, y_s), (x_t, y_t) \\in \\{1, \\dots, n\\} \\times \\{1, \\dots, m\\} $ be the start and tar...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments