I. PLAYERUNKNOWN'S BATTLEGROUNDS

Codeforces
IDCF10177I
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
PLAYERUNKNOWN'S BATTLEGROUNDS (PUBG, also known as "Chicken Dinner") is the most popular survival shooter game in recent months. Players are dropped into a wide, open area, and they must fight with each other until the last person survives. Specifically, there is a shrinking circle called safe area in the battlefield, while players outside this area will suffer continued damage, which forces them to confront each other and creates chances of skirmish. Some players are particularly stupid, so they became users of the WG company. But recently, WG company often receive complaints from users that they often die outside the safe area. After carefully study, WG company found that their users are too stupid to know how to run into the safe area. Therefore, they decided to assist their users to complete this action. After creating a coordinate system on the map, the player is at (x0, y0) point at moment 0, with movement speed v. At this moment, there is a circle C1 with radius of r1 and center at (x1, y1) indicating the safe area now. And players outside the safe area will get d1 continued damage per unit of time. The safe area will start to shrink at time t1 and becomes a smaller circle C2 at time t2, whose center is (x2, y2) and has radius r2. Since then, players outside the safe area will get d2 damage per unit of time. C2 is strictly in C1, and the change of circle radius and the movement of circle center are at a constant speed. However, damages outside the safe area will change from d1 to d2 instantly at t2. Your mission is to calculate the minimum damage the player incurs from the moment 0 till he/she reaches the final safe area C2 if the player moves optimally. The first line of the input gives the number of test cases, T. T test cases follow. Each test case contains three lines. The first line contains three integers x0, y0 and v, indicating the initial position and moving speed of player. The second line contains five integers x1, y1, r1, d1 and t1, while the third line also contains five integers x2, y2, r2, d2 and t2, as described above respectively. For each test case, output one line containing "_Case #x: y_", where _x_ is the test case number (starting from 1) and _y_ is the minimum damages. _y_ will be considered correct if it is within an absolute or relative error of 10 - 4 of the correct answer. ## Input The first line of the input gives the number of test cases, T. T test cases follow.Each test case contains three lines. The first line contains three integers x0, y0 and v, indicating the initial position and moving speed of player. The second line contains five integers x1, y1, r1, d1 and t1, while the third line also contains five integers x2, y2, r2, d2 and t2, as described above respectively. 1 ≤ T ≤ 100. 0 ≤ x0 ≤ 80000. 0 ≤ y0 ≤ 80000. 50 ≤ v ≤ 400. Every point(x, y) on C1 has 0 ≤ x ≤ 80000 and 0 ≤ y ≤ 80000. C2 is strictly in C1. 1 ≤ d1 ≤ d2 ≤ 11. 0 ≤ t1 ≤ t2 ≤ 80000. ## Output For each test case, output one line containing "_Case #x: y_", where _x_ is the test case number (starting from 1) and _y_ is the minimum damages. _y_ will be considered correct if it is within an absolute or relative error of 10 - 4 of the correct answer. [samples]
**Definitions** Let $ T \in \mathbb{Z} $ be the number of test cases. For each test case $ k \in \{1, \dots, T\} $, let: - $ a_k $: goals scored by Team 1 at home (first match) - $ b_k $: goals scored by Team 2 away (first match) - $ c_k $: goals scored by Team 1 away (second match) - $ d_k $: goals scored by Team 2 at home (second match) **Constraints** 1. $ 1 \le T \le 500 $ 2. For each $ k $, $ 0 \le a_k, b_k, c_k, d_k \le 10 $ **Objective** For each test case $ k $, determine the winner based on: - Aggregate score: $ S_1 = a_k + c_k $ (Team 1), $ S_2 = b_k + d_k $ (Team 2) - If $ S_1 > S_2 $: output $ 1 $ - If $ S_2 > S_1 $: output $ 2 $ - If $ S_1 = S_2 $: - Compare away goals: $ c_k $ (Team 1 away) vs. $ b_k $ (Team 2 away) - If $ c_k > b_k $: output $ 1 $ - If $ b_k > c_k $: output $ 2 $ - If $ c_k = b_k $: output $ -1 $
API Response (JSON)
{
  "problem": {
    "name": "I. PLAYERUNKNOWN'S BATTLEGROUNDS",
    "description": {
      "content": "PLAYERUNKNOWN'S BATTLEGROUNDS (PUBG, also known as \"Chicken Dinner\") is the most popular survival shooter game in recent months. Players are dropped into a wide, open area, and they must fight with ea",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10177I"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "PLAYERUNKNOWN'S BATTLEGROUNDS (PUBG, also known as \"Chicken Dinner\") is the most popular survival shooter game in recent months. Players are dropped into a wide, open area, and they must fight with ea...",
      "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\\} $, let:  \n- $ a_k $: goals scored by Team 1 at home (first match)  \n- $ b_k $: goal...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments