2648Elastic Ball in the Frame

2648   Elastic Ball in the Frame

题目描述

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.

输入样例 复制
2
1 45 2 2 2
1 53.13 4 6 10
输出样例 复制
(1.41,1.41)
(6.00,0.00)

说明

  Sample 1 and sample 2 are shown below.
17
52
通过提交
时空限制2000ms/64mb
题目来源数据结构实验与竞赛训练
评测方式在线评测
题目类型
难        度