7434: Avian Darts

内存限制:128 MB 时间限制:2 S
题面:传统 评测方式:文本比较 上传者:
提交:3 通过:0

题目描述

International Combat Aerobatics Competition “Avian Darts” is opening soon and Andrei was selected as a participant.

He and his wingmen planned several awesome aerobatic flights that will certainly delight the judges and award them gold medals. The only problem is to form a formation at the end of competition and that’s why they want to know their exact coordinates and attitudes after performing aerobatics.



He navigates his aircraft by using the joystick and pedals to roll, pitch and yaw. Aerobatic flights consist of courses whose rotational speeds about three axes of the aircraft are given. As you know, direction of velocity always aims the frontwards of the aircraft.

Their aircrafts are 5th generation aircrafts: “Су-57 (Sukhoi-57)”. Therefore, they are not affected by weather and never enter a stall which means that they’re very safe during flight.

You can ignore thrust vectoring, angle of attack, size of aircraft, lift, air resistance, inertia and gravity in this problem.

输入格式

Input consists of multiple test cases.

First line of each test case contains a non-negative integer n (≤10), the number of courses during the flight.

The next n lines contain 5 integers ωxωyωz, v and t.

ωxωyωz are rotational speeds of rolling, pitching, yawing in degrees per second and then, v and t denote speed of aircraft in ms−1 and duration in seconds.

Aircraft rolls to the left if ωx<0 while it rolls to the right if ωx>0. It climbs (dives) if ωy<0 (ωy>0). It also slides right (left) if ωz<0 (ωz>0).

|ωx |≤180, |ωy |≤120, |ωz |≤60, 100≤v≤500, 0<t≤10

It is guaranteed that there will be no more than 104 test cases.

Input is terminated with end of file.

Initially, Andrei’s aircraft is located at (0,0,0) and unit vectors towards its front, left and up are {1,0,0}, {0,1,0} and {0,0,1} as shown in the figure.

输出格式

Answer for each test case has four lines each of which contains 3 real numbers.
Output x, y and z coordinates on the first line.
On the second line, output x, y and z elements of a unit vector towards the front. Output unit vectors towards the left and up on the third and fourth lines respectively.
Lengths of unit vectors must be equal to 1. Your answer will be acceptable if its absolute or relative error does not exceed 10−6.
Output a blank line after each test case.

输入样例 复制

1
60 0 0 340 3
2
90 0 0 500 1
0 -30 0 200 3
1
0 0 30 100 6

输出样例 复制

1020.000 0.000 0.000
1.000 0.000 0.000
0.000 -1.000 0.000
0.000 0.000 -1.000

881.97186342 -381.97186342 0.000
0.000 -1.000 0.000
0.000 0.000 1.000
-1.000 0.000 0.000

0.000 381.97186342 0.000
-1.000 0.000 0.000
0.000 -1.000 0.000
0.000 0.000 1.000

数据范围与提示

Hint
p shows the coordinates of Andrei. i, j and k are unit vectors towards front, left and up of the aircraft.