Hdu5033
来源:互联网 发布:知识管理 知乎 编辑:程序博客网 时间:2024/04/29 03:23
Building
Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 669 Accepted Submission(s): 194
Special Judge
Problem Description
Once upon a time Matt went to a small town. The town was so small and narrow that he can regard the town as a pivot. There were some skyscrapers in the town, each located at position xi with its height hi. All skyscrapers located in different place. The skyscrapers had no width, to make it simple. As the skyscrapers were so high, Matt could hardly see the sky.Given the position Matt was at, he wanted to know how large the angle range was where he could see the sky. Assume that Matt's height is 0. It's guaranteed that for each query, there is at least one building on both Matt's left and right, and no building locate at his position.
Input
The first line of the input contains an integer T, denoting the number of testcases. Then T test cases follow.
Each test case begins with a number N(1<=N<=10^5), the number of buildings.
In the following N lines, each line contains two numbers, xi(1<=xi<=10^7) and hi(1<=hi<=10^7).
After that, there's a number Q(1<=Q<=10^5) for the number of queries.
In the following Q lines, each line contains one number qi, which is the position Matt was at.
Each test case begins with a number N(1<=N<=10^5), the number of buildings.
In the following N lines, each line contains two numbers, xi(1<=xi<=10^7) and hi(1<=hi<=10^7).
After that, there's a number Q(1<=Q<=10^5) for the number of queries.
In the following Q lines, each line contains one number qi, which is the position Matt was at.
Output
For each test case, first output one line "Case #x:", where x is the case number (starting from 1).
Then for each query, you should output the angle range Matt could see the sky in degrees. The relative error of the answer should be no more than 10^(-4).
Then for each query, you should output the angle range Matt could see the sky in degrees. The relative error of the answer should be no more than 10^(-4).
Sample Input
331 22 15 11431 32 25 11431 42 35 114
Sample Output
Case #1:101.3099324740Case #2:90.0000000000Case #3:78.6900675260
0 0
- HDU5033
- Hdu5033
- HDU5033 building
- hdu5033 单调栈
- hdu5033 最大仰望角
- hdu5033 Building 单调队列
- hdu5033 Building 凸包
- hdu5033 Building单调栈
- HDU5033 - Building(暴力,DP思想)
- HDU5033-Building(维护单调栈)
- hdu5033 Building(单调栈)
- hdu5033 Building 北京网络赛B题 单调栈
- 参数文件
- sql临时表删除
- hdu 5024——Wang Xifeng's Little Plot
- 当finish掉activity线程时,它所加载的webview线程没有被卸载掉
- Linux下进入single模式与Linux下挂载U盘
- Hdu5033
- 演示:多格式文件内嵌入WPF资源文件
- Java中的数字证书的生成及维护方法
- bitset 用法
- 【LeetCode】-Binary Tree Postorder Traversal
- HDU 5033 - Building
- erlang 学习记录
- 可交互的AsyncTask
- phpmyadmin导入.sql数据库文件报错解决