F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Area

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 301    Accepted Submission(s): 33


Problem Description
  To make sure that our company has the most immutable mobile phone all over the world, the Mokia decide to monitor all the cellphones on Earth. They have launched two satellites in order to track the information about hardness of the mobile phones. Although the satellites are able to scan all the mobile phones visible to them, unfortunately, with only two satellites, our Mokia can't cover all surface on Earth simultaneously. One satellite can only monitor the surface which is unblock to its current location. The satellite can only be blocked by the Earth itself, that is to say, one point of the Earth's surface is visible to one satellite if and only if the line between this point and the satellite does not intersect with Earth. No relativistic effects are considered.

  The CEO of Mokia, Steve, wants to get the current coverage ratio of the satellites. Since we only know the current location of the satellites, it is very hard to know the exact number of ratio. To simplify this task, we can consider Earth as a perfect sphere of radius R. With this simplification, and the locations of the satellites, this task is pretty easy.
 

Input
  The input file leads with one line contains the number of test cases T. (T <= 1000)
  For each test case, the first line contains only one real number R (0.01 <= R <= 10000), indicating the radius of Earth.
  The second line and third line each contains three real numbers, indicating the current location of the two satellites (-100000 <= x, y, z <= 100000). And you may assume the origin of coordinate system is located on the center of Earth, and two satellites are above the surface of Earth.
  Also, all real numbers have at most two digits after the decimal point.
 

Output
  For each test cases, output only one line with the test number and the coverage of the two satellites. All coverage should be presented as percentages and rounded to five decimal places.
 

Sample Input
2 1 0 0 2 0 0 -2 1 0 0 2 0 0 -2.5
 

Sample Output
Case #1: 50.00000% Case #2: 55.00000%
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-25 13:20:39, Gzip enabled