In a rectangular frame, there’s an elastic ball which can be regarded as a mass point(The ball can make elastic collisions with the frame).The frame lies on a smooth horizontal plane, and the initial position of the ball is at the lower left quarter(左下角)of the frame. Taking horizontal border as x axis and the vertical border as y axis, we can build the coordinate(坐标系). The position of the ball is (0,0).Given the ball’s initial speed, you are supposed to find its position at time t. (The collision trace of the ball forms a mirror reflection.)
输入格式:
There is a positive integer n(n<1000) on the first line, representing the case number. There follows n lines, each line has 5 positive number, v(0<v<100), a(0<a<90), l(0<l<100), d(0<d<100),t(0<t<107),representing the ball’s initial speed, the intersection angle between the ball’s initial speed and the x axis, the length of the vertical border, the length of the horizontal border, and the queried time respectively.
输出格式:
For each case, output the corresponding position in the (x,y) form, keeping two decimal places.