Pro.ID21611 TitleBall Title链接http://10.20.2.8/oj/exercise/problem?problem_id=21611 AC0 Submit0 Ratio- 时间&空间限制描述One day, Merlin buys a huge box which has no cover but unlimited height. And then he throws a lot of balls into the box. Then all the balls will fall down and hit each other. After a while, Merlin wants to know the detail of each ball. Can you tell him? We suppose that the box is just like the Figure 1, it has no cover and unlimited height, both side of wall and the bottom. The balls hit the wall and bottom will not lose any energy and so as the collision of the balls. At last, we call ignore the radium of the balls and consider all the balls are the same and they are running in a 2D box. We assume that the accelerated of gravity is g=10s -1. Figure 1 The box and the balls 输入There are multiply test cases in this problem. In each test case, the first line is three integers n, w, t ( n ≤ 10000, t ≤ 100 ), n stands for the number of balls, w is the wide of the box and t is time what Merlin wants to know. And then there are n lines of four real numbers, xi, yi, vxi, vyi, ( 0 ≤ xi, yi ≤ 10000, -10000 ≤ vxi, vyi ≤ 10000 ) that means the i-th ball is at (xi, yi) and has the velocity (vxi, vyi). We suppose that the down-left point is (0, 0) and then the down-right point is (0, w). The test cases will be terminated by n=0. 输出Description One day, Merlin buys a huge box which has no cover but unlimited height. And then he throws a lot of balls into the box. Then all the balls will fall down and hit each other. After a while, Merlin wants to know the detail of each ball. Can you tell him? We suppose that the box is just like the Figure 1, it has no cover and unlimited height, both side of wall and the bottom. The balls hit the wall and bottom will not lose any energy and so as the collision of the balls. At last, we call ignore the radium of the balls and consider all the balls are the same and they are running in a 2D box. We assume that the accelerated of gravity is g=10s -1. Figure 1 The box and the balls Input There are multiply test cases in this problem. In each test case, the first line is three integers n, w, t ( n ≤ 10000, t ≤ 100 ), n stands for the number of balls, w is the wide of the box and t is time what Merlin wants to know. And then there are n lines of four real numbers, xi, yi, vxi, vyi, ( 0 ≤ xi, yi ≤ 10000, -10000 ≤ vxi, vyi ≤ 10000 ) that means the i-th ball is at (xi, yi) and has the velocity (vxi, vyi). We suppose that the down-left point is (0, 0) and then the down-right point is (0, w). The test cases will be terminated by n=0. Output Print the location of each ball at time t in x ascend order and then in y ascend order, round to 3 digits after the decimal point. Print one empty line after each test case. Sample Input 2 10 2 Sample Output 5.000 0.000 Source 样例输入2 10 2 样例输出5.000 0.000 作者 |