Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/matritsa-songa-kopaytirish

Multiply a matrix by a number

Easy 1000 ms 64 MB 31%
Share

A matrix of size $n \times m$ and an integer $k$ are given. Multiply every element of the matrix by $k$ and print the resulting matrix.

A matrix and the number k; a new matrix with every cell multiplied by k

Input

The first line contains three integers $n$, $m$ and $k$.
Each of the next $n$ lines contains $m$ integers — the matrix.

Output

$n$ lines with $m$ integers each.

Note

$1 \le n, m \le 100$
$-1000 \le k, a_{i,j} \le 1000$

Examples

Input #1
2 3 -2
1 0 4
-3 5 2
Output #1
-2 0 -8
6 -10 -4
Input #2
1 1 0
7
Output #2
0

Sign in to submit a solution

Signing up is free and takes a minute.