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

How high is the Building

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 427    Accepted Submission(s): 101


Problem Description
One day, zp, wangchaohui and snowingsea passed by Science Building on the way to have dinner, after their working on puzzle.


zp asks:¡±Do you know how high the building is?¡±, but none of them knew. "So let¡¯s measure it!", snowingsea shouted out. Then they borrowed n theodolites£¨a tool used to measure angle of elevation£©. The n theodolites were placed on the ground around the building, which formed an n-edge regular polygon. The building was inside the regular polygon. Each edge of the polygon is s meters, and the height of theodolite was h centimeters. They wrote down the angle of elevation in degrees from each theodolite to the top of the building. They wanted to calculate the building's height according to the data they measured. Can U help them.
 

Input
The input consists of several test cases. The first line contains an integer T representing the number of test cases. Each test case contains two lines. The first line contains three integers, they are n, s, h, ( described in problem's description ). The second line contains n float numbers, which are the angles of each elevation they wrote down. 3 ¡Ü n ¡Ü 100, 0 < s, h < 10 000.
 

Output
For each case, print the height of the science building in meters in a separate line. The answer should be rounded to four decimal digits.
 

Sample Input
1 3 100 100 60 60 60
 

Sample Output
101.0000
 

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-11-22 23:47:09, Gzip enabled