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

Polaris of Pandora

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


Problem Description
Polaris is a star. It is the most magnificent scene in the sky, and the most important navigation star of planet Pandora[1]. People live in Pandora call themselves as "Na'vi"[2], and they all love to fly in the sky with their ikran[3]. When they are flying in the sky, they use Polaris to navigate. Polaris could be used to navigate because that it is always staying in the straight line linking the North Pole and the South Pole of Pandora. That straight line could also be called as "axis of Pandora", and Polaris stays on the North Pole side.
Polaris is too far away from Pandora, so in every place near Pandora, light from Polaris could be regarded as parallel to axis of Pandora. Now several Na'vi ikran riders are flying in the sky of Pandora, they want to know the percentage of their whole flying distance that Polaris is visible. Polaris's light is quite bright, so Polaris is visible even when it is just on the skyline.
To simplify the problem, Na'vi riders assume that Pandora is a perfect sphere, which have an R radius. A rider starts flying from a point on the Pandora's surface and lands at another point, the flying height is given as H. Ikran is so powerful that flying time between the surface of Pandora and the flying height could be ignored, and ikran will always fly straight up and down between surface and flying height. Both the starting point and the landing point could be described using latitude and longitude [4] of Pandora. And riders will always choose the shortest path to fly.
 

Input
There are several test cases. Process to the end of file.
The only line of each test case contains 6 real numbers R (1000 ¡Ü R ¡Ü 10000), H (1 ¡Ü H ¡Ü R), lat0 (-¦Ð/2 < lat0 < ¦Ð/2), lng0 (-¦Ð < lng0 < ¦Ð), lat1 (-¦Ð/2 < lat1 < ¦Ð/2), lng1 (-¦Ð < lng1 < ¦Ð). R is radius of planet Pandora, H is Na'vi ikran rider's flying height, lat0 and lng0 are latitude and longitude of starting point, lat1 and lng1 are latitude and longitude of landing point.
We guarantee that starting point and landing point will not be the same, and they also will not be "opposite" (Starting point, landing point and Pandora's center will not be in the same line.)
 

Output
For each test case, output one line with the percentage of the flying distance that Polaris is visible. Round to 3 decimal places.
 

Sample Input
1000 10 0 0 0 0.5 4000 1000 0 0.618 1.0 0.618
 

Sample Output
100.000 64.350
 

Hint

Reference
[1] Pandora is the fifth moon of the gas giant Polyphemus (both are figures in Greek mythology), which orbits the closest star to the sun, Alpha
Centauri A.
[2] The Na'vi (English: The People) are a race of sentient extraterrestrial humanoids who inhabit the lush jungle moon of Pandora.
[3] Ikran (English: Mountain banshees) are large, bird-like aerial predators that are native to Pandora. They are used by the Na'vi for hunting from the
air and traveling larger distances.
[4] To define latitude and longitude of Pandora, we need to know equator of the planet. The equator is the intersection of Pandora's surface with the
plane perpendicular to axis of Pandora and containing the planet's center. Latitude is a geographic coordinate that specifies the north-south position of a point on the
Pandora's surface, it is the angle between the equator and the line connected point on the surface with the planet's center. Latitude is an angle which ranges from -¦Ð/2
at the North pole to ¦Ð/2 at the South pole. Longitude is a geographic coordinate that specifies the east-west position of a point on the Earth's surface. Points with the
same longitude lie in lines running from the North Pole to the South Pole. The longitude of a point on the surface is measured as an angle east or west from the
Hometree [5], ranging from 0 at the Hometree to ¦Ð eastward and -¦Ð westward. Specifically, it is the angle between a plane
containing the Hometree and a plane containing the North Pole, South Pole and the point on the surface.
[5] Hometrees (Na'vi name: Kelutral) are massive trees that can be found throughout Pandora. Many Na'vi clans make these enormous plants their
home.
 

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-05-04 22:28:10, Gzip enabled