Multiply every element of a matrix by a scalar value.
For a matrix A and scalar k, the product B = kA is calculated as:
B[i][j] = k × A[i][j]