#C1061. Matrix Product with Inverse

    ID: 39834 Type: Default 1000ms 256MiB

Matrix Product with Inverse

Matrix Product with Inverse

Given a 2x2 matrix represented by four numbers in row-major order, compute the product of the matrix with its inverse. Mathematically, if (A) is an invertible matrix, then (A \times A^{-1} = I), where (I = \begin{bmatrix}1 & 0\0 & 1\end{bmatrix}) is the identity matrix. Read the matrix from standard input (stdin) and output the resulting matrix to standard output (stdout) with each row printed on a new line.

inputFormat

The input consists of exactly four space-separated numbers (a, b, c, d) representing a 2x2 matrix in row-major order.

outputFormat

Output the 2x2 matrix resulting from the product of the given matrix and its inverse. Each row should be printed on a new line with the numbers separated by a space. The output should be the identity matrix (I = \begin{bmatrix}1 & 0\0 & 1\end{bmatrix}).## sample

1 2 3 4
1.0 0.0

0.0 1.0

</p>