当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3515:How high is the Building

题目描述
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.
输入解释
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.
输出解释
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.
输入样例
1
3 100 100
60 60 60
输出样例
101.0000
来自杭电HDUOJ的附加信息
Recommend zhouzeyong

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-3515

最后修改于 2020-10-25T23:04:19+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 65536/32768K(Java/Others)