Skip to main content
LIVE CONTEST: Round #7 · Begin Marathon is live now! …

~/algor $ cat problems/matrix/multiply-a-matrix-by-a-number

Multiply a matrix by a number

Author Iqbolshoh Ilhomjonov 3 @iqbolshoh 650 problems
Easy 1000 ms 64 MB 31%
Share

A matrix of size and an integer are given. Multiply every element of the matrix by 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 , and .
Each of the next lines contains integers — the matrix.

Output

lines with integers each.

Note


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.