POJ 1039 Pipe
来源:互联网 发布:围棋有多少种变化知乎 编辑:程序博客网 时间:2024/04/30 19:47
Pipe
Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 4582 Accepted: 1351
Description
The GX Light Pipeline Company started to prepare bent pipes for the new transgalactic light pipeline. During the design phase of the new pipe shape the company ran into the problem of determining how far the light can reach inside each component of the pipe. Note that the material which the pipe is made from is not transparent and not light reflecting.
Each pipe component consists of many straight pipes connected tightly together. For the programming purposes, the company developed the description of each component as a sequence of points [x1; y1], [x2; y2], . . ., [xn; yn], where x1 < x2 < . . . xn . These are the upper points of the pipe contour. The bottom points of the pipe contour consist of points with y-coordinate decreased by 1. To each upper point [xi; yi] there is a corresponding bottom point [xi; (yi)-1] (see picture above). The company wants to find, for each pipe component, the point with maximal x-coordinate that the light will reach. The light is emitted by a segment source with endpoints [x1; (y1)-1] and [x1; y1] (endpoints are emitting light too). Assume that the light is not bent at the pipe bent points and the bent points do not stop the light beam.
Each pipe component consists of many straight pipes connected tightly together. For the programming purposes, the company developed the description of each component as a sequence of points [x1; y1], [x2; y2], . . ., [xn; yn], where x1 < x2 < . . . xn . These are the upper points of the pipe contour. The bottom points of the pipe contour consist of points with y-coordinate decreased by 1. To each upper point [xi; yi] there is a corresponding bottom point [xi; (yi)-1] (see picture above). The company wants to find, for each pipe component, the point with maximal x-coordinate that the light will reach. The light is emitted by a segment source with endpoints [x1; (y1)-1] and [x1; y1] (endpoints are emitting light too). Assume that the light is not bent at the pipe bent points and the bent points do not stop the light beam.
Input
The input file contains several blocks each describing one pipe component. Each block starts with the number of bent points 2 <= n <= 20 on separate line. Each of the next n lines contains a pair of real values xi, yi separated by space. The last block is denoted with n = 0.
Output
The output file contains lines corresponding to blocks in input file. To each block in the input file there is one line in the output file. Each such line contains either a real value, written with precision of two decimal places, or the message Through all the pipe.. The real value is the desired maximal x-coordinate of the point where the light can reach from the source for corresponding pipe component. If this value equals to xn, then the message Through all the pipe. will appear in the output file.
Sample Input
40 12 24 16 460 12 -0.65 -4.457 -5.5712 -10.817 -16.550
Sample Output
4.67Through all the pipe.
- POJ 1039 Pipe
- POJ 1039 Pipe
- POJ 1039 Pipe
- POJ 1039 Pipe
- POJ 1039 Pipe
- POJ 1039 Pipe
- POJ 1039 Pipe
- POJ 1039 Pipe
- poj 1039 Pipe
- POJ 1039 pipe
- POJ 1039--Pipe
- poj 1039 Pipe
- Pipe - POJ 1039 几何
- POJ 1039 Pipe
- poj 1039 Pipe
- POJ-1039-Pipe
- POJ 1039 Pipe
- poj 1039 Pipe
- (有点意思)QQ信息发送机
- Arm结构下 kernel是如何编译出zImage的。
- 摘录qq的第二封信,我觉得还是挺客观的
- Flex报表技术备忘(转)
- SDD
- POJ 1039 Pipe
- [PostgreSQL]内存分配系统的重新设计
- Code coverage并非万能的
- [Introduction] - Hui Zhong
- JSplitPane
- 第一次
- mysql汉字拼音取法
- 汇编语言常见的错误提示代码及含义
- JSplitPane: resetToPreferredSizes()