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

Transform

Time Limit: 8000/4000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)
Total Submission(s): 38    Accepted Submission(s): 21
Special Judge


Problem Description
Given you two points $(A, B, C)$ and $(x, y, z)$ in 3D space. Let $L$ be the line cross the point $(A, B, C)$ and the original point $(0, 0, 0)$. You will get two points $P$ and $Q$ if you rotate point $(x, y, z)$ around line $L$ by $r$ degree and $-r$ degree. If the $z$ coordinate of $P$ is greater than $Q$, output $P$. Otherwise, output $Q$. We guarantee that the solution is unique.
 

Input
This problem contains multiple test cases.

The first line of the input contains an integer $T (1 \leq T \leq 50000)$, indicating the number of test cases.

Each of the following $T$ lines contains seven integers $A, B, C, x, y, z, r$.

($1 \leq A, B, C, x, y, z \leq 100, 1 \leq r < 180$).
 

Output
For each test case, output one line contains three real numbers indicates the coordinate of the answer.

Your answer will be accepted if the absolute or relative error between your answer and the standard answer is less than $10^{-6}$.
 

Sample Input
1 1 2 3 4 5 6 7
 

Sample Output
4.084934830 4.801379781 6.104101869
 

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-11-22 07:04:32, Gzip enabled