#P4894. Find the Normal Vector of a Plane

    ID: 18135 Type: Default 1000ms 256MiB

Find the Normal Vector of a Plane

Find the Normal Vector of a Plane

Given two intersecting vectors \(\overrightarrow{a}=(x_1,y_1,z_1)\) and \(\overrightarrow{b}=(x_2,y_2,z_2)\) in a plane \(\alpha\), a normal vector \(\overrightarrow{z}=(x,y,z)\) to that plane can be obtained by computing the cross product:

\[ \overrightarrow{z}=\overrightarrow{a}\times\overrightarrow{b}=\left(y_1z_2-z_1y_2,\; z_1x_2-x_1z_2,\; x_1y_2-y_1x_2\right). \]

Your task is to compute \(\overrightarrow{z}\) given the coordinates of \(\overrightarrow{a}\) and \(\overrightarrow{b}\). Output the coordinates of the normal vector.

inputFormat

The input contains one line with 6 space-separated integers: x1 y1 z1 x2 y2 z2, representing the coordinates of vectors \(\overrightarrow{a}\) and \(\overrightarrow{b}\) respectively.

outputFormat

Output a single line with 3 space-separated integers representing the coordinates of the normal vector \(\overrightarrow{z}\) computed as \(\overrightarrow{a}\times\overrightarrow{b}\).

sample

1 0 0 0 1 0
0 0 1