| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 | 1024 MB | 42 | 14 | 12 | 38.710% |
A simple motion over and over...
t.A.T.u., <<A Simple Motion>>
Julia loves simple motions very much especially in three-dimensional space! Recently she found a matrix that corresponds with some rotation around an axis that goes through the origin. Rotation is defined by unit vector $v = \begin{pmatrix} v_x \\ v_y \\ v_z \end{pmatrix}$ and rotation angle $\alpha$.
Suppose you look at the origin from the end of $v$ then if rotation is going counter-clockwise then $\alpha$ will be positive, negative overwise.
Rotation matrix moves point $\begin{pmatrix} x \\ y \\ z \end{pmatrix}$ to $\begin{pmatrix} x' \\ y' \\ z' \end{pmatrix}$ like this: $$ \begin{pmatrix} x' \\ y' \\ z' \end{pmatrix} = \begin{pmatrix} A_{11} & A_{12} & A_{13} \\ A_{21} & A_{22} & A_{23} \\ A_{31} & A_{32} & A_{33} \\ \end{pmatrix} \times \begin{pmatrix} x \\ y \\ z \end{pmatrix}. $$
Unfortunately Julia doesn't know values of $v$ and $\alpha$, so she asked you to restore them and then she will continue her simple motion.
You are given matrix $A$. It is guaranteed that there is such rotation matrix $A'$ that $|A'_{ij} - A_{ij}| < 10^{-13}$.
First line should contain $\alpha$ in degrees. Second line should contain coordinates of unit vector $v$. It is guaranteed that $1 \le |\alpha| \le 179$. Output all number as precise as you can. Your answer will be considered correct if the difference between $A_{ij}$ and the matrix constructed from your angle and unit vector will not exceed $10^{-6}$.
0 -1 0 1 0 0 0 0 1
90 0 0 1