시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 1024 MB2000.000%

문제

Ostap is strolling leisurely along the Yessentuki-Moscow route, and scuttling along him is Kislarsky, begging to take his Parabellum away. Kislarsky keeps distance to Ostap strictly constant. Also he keeps constant his speed relative to the ground. He is moving counterclockwise relative to Ostap. Ostap's velocity stays constant (both direction and magnitude-wise).

Help Kislarsky to get away from the Alliance of the Sword and Ploughshare. Find the coordinates of the points where he will be in the given time moments $t_i$.

입력

The first line of the input file contains eight integers: $p_x$, $p_y$, $q_x$, $q_y$, $u_x$, $u_y$, $v$, $N$, where:

  • $p_x$, $p_y$ --- the location of Ostap in the initial moment ($|p_x|, |p_y| \le 10^4$),
  • $q_x$, $q_y$ --- the location of Kislarsky in the initial moment ($|q_x|, |q_y| \le 10^4$),
  • $u_x$, $u_y$ --- the projections of Ostap's velocity upon the coordinate axes $OX$ and $OY$ respectively ($|u_x|, |u_y| \le 10$),
  • $v$ --- the speed of Kislarsky relative to the ground ($\sqrt{u_x^2 + u_y^2} + \frac{1}{2} < v \le 10$),
  • $N$ --- the number of time moments when the location of Kislarsky is of interest ($1 \le N \le 100\,000$).

The second line contains $N$ real numbers $t_i$ -- the moments in time for which the location of Kislarsky must be found ($0 \le t_i \le 1000$). All numbers $t_i$ are provided with at most five digits after decimal point.

It is guaranteed that initial locations of Ostap and Kislarsky are different.

출력

The output file must contain $N$ pairs of real numbers (two per line): $X$ and $Y$ coordinates of Kislarsky's location at the time moment $t_i$.

The absolute or relative error of each number must not exceed $10^{-5}$.

예제 입력 1

2 3 4 5 1 1 2 10
1 2 3 4 5 6 7 8 9 10.00

예제 출력 1

3.311667781 6.811203158
1.618058050 6.525238521
2.396313856 4.895093459
4.356603786 4.697990251
6.268584256 5.267779107
8.050839947 6.172029827
9.724368272 7.265902232
11.304988035 8.490616365
12.800188718 9.818413289
14.210788762 11.235796766