405075: GYM101775 I PLAYERUNKNOWN'S BATTLEGROUNDS

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

I. PLAYERUNKNOWN'S BATTLEGROUNDStime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

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.

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.

ExampleInput
3
700 100 50
600 600 600 5 0
800 400 200 10 2
700 0 80
600 600 600 5 0
800 400 200 10 2
100 100 150
600 600 600 5 1
800 800 200 10 4
Output
Case #1: 4.2537599506
Case #2: 16.5388203202
Case #3: 28.4702942691

加入题单

上一题 下一题 算法标签: