Solve problem "Scale a matrix" online - Learn Python 3 - Snakify
Processing math: 100%

Scale a matrix


Statement

Given two positive integers m and n, m lines of n elements, giving an m×n matrix A, followed by one integer c, multiply every entry of the matrix by c and print the result.
Advertising by Google, may be based on your interests

In all the problems input the data using input() and print the result using print().

# Read an integer:
# a = int(input())
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Input:
3 4
11 12 13 14
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Output:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Saved solutions

Tests

InputCorrect answer
3 4
11 12 13 14
21 22 23 24
31 32 33 34
2
22 24 26 28
42 44 46 48
62 64 66 68
2 2
1 2
3 4
0
0 0
0 0
10 1
1
2
3
4
5
6
7
8
9
10
-1
-1
-2
-3
-4
-5
-6
-7
-8
-9
-10
4 3
1 2 3
4 5 6
7 8 9
10 11 12
1
1 2 3
4 5 6
7 8 9
10 11 12
1 1
9
9
81