- 1. Entrée, impression et numéros
- 2. Numéros entiers et flottants
- 3. Conditions: si-alors-autrement
- 4. Pour boucle avec plage
- 5. Cordes
- 6. Boucle en boucle
- 7. Listes
- 8. Fonctions et récursivité
- 9. Listes bidimensionnelles (tableaux)
- 10. Ensembles
- 11. Dictionnaires
- 12. JavaScript
- 13. HTML5 and CSS
- 14. Responsive Design with Bootstrap
- 15. jQuery
Ad place
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()
.
12# Read an integer:# a = int(input())XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Input:
3 411 12 13 14XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Output:
1XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Saved solutions
Tests
Input | Correct 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 |