F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Avian Darts

Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)
Total Submission(s): 139    Accepted Submission(s): 52
Special Judge


Problem Description
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 $5^{th}$ 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
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 $10^4$ 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.
 

Output
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.
 

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

Sample Output
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.
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-19 15:18:58, Gzip enabled