#K73072. 2x2 Matrix Multiplication
2x2 Matrix Multiplication
2x2 Matrix Multiplication
In this problem, you need to multiply two 2x2 matrices. You will be given eight integers representing the components of two matrices. The first four integers represent the matrix
and the next four represent the matrix
The result of the multiplication is computed using the formula:
$$\begin{pmatrix} a & b \\ c & d \end{pmatrix} \times \begin{pmatrix} e & f \\ g & h \end{pmatrix} = \begin{pmatrix} a\times e + b\times g & a\times f + b\times h \\ c\times e + d\times g & c\times f + d\times h \end{pmatrix} $$You are required to output the resulting matrix components in a single line separated by spaces.
inputFormat
The input is given via standard input (stdin) as a single line containing 8 integers separated by spaces. The first four integers (a, b, c, d) correspond to the first matrix and the next four integers (e, f, g, h) correspond to the second matrix.
outputFormat
Output the four components of the resulting matrix in one line, separated by a single space. The order is: (a', b', c', d') where:
$$d' = c \times f + d \times h $$## sample1 2 3 4 5 6 7 8
19 22 43 50
$$