Completed Start: 10 Nov 2024, 09:00 End: 10 Nov 2024, 13:00 Timezone: Asia/Almaty

Gravitational matrix

10s
512MiB

Arman, known as the Gravitational Architect, encountered a problem in creating a stable gravitational field on the FAIO space station. To solve this, he needs to calculate complex matrices representing the interactions of gravitational fields. This calculation requires substantial effort, so he decided to seek help from Roony, the Spatial Stabilization Technician. Together, they plan to find the result of multiplying two matrices, representing different gravitational parameters.

The input consists of three natural numbers $a$, $b$, and $c$ – the dimensions of the matrices, where $a$ and $b$ are the number of rows and columns of the first matrix, and $b$ and $c$ are the number of rows and columns of the second matrix. Then, $a$ lines follow, each containing $b$ real numbers, representing the values in the first matrix.

Then $b$ lines are provided, each containing $c$ real numbers, representing the values in the second matrix.

It is necessary to output the result of multiplying the first matrix by the second so that Roony can correctly stabilize the gravitational processes on the station.

Constraints:

  • For matrix multiplication to be valid, the number of columns in the first matrix must match the number of rows in the second matrix: $b$.
  • Limits on matrix dimensions: $1 \leq a, b, c \leq 300$.

The result of the multiplication will help Arman and Roony achieve stable artificial gravity and successfully complete their mission.

Output format: The result of multiplying the two matrices should be presented as $a$ rows, each containing $c$ real numbers separated by spaces.

Login to submit

You need to be signed in to submit solutions and track your submissions.

Log In