Your task is to write a program that starts reading and printing a matrix of integers . Afterwards, for each pair of natural numbers and given, print the previous matrix with the columns and swapped. The columns are counted from 0 to .
Using the definition
typedef vector<vector<int> > Matrix;
your program must implement and use the function
void swap(Matrix& mat, int j, int k);
that, given a matrix |mat| and the natural numbers and , swaps the columns and of |mat|. The indices and will always be between 0 and the number of columns of |mat| minus one.
The input starts with the size and of the matrix, followed by lines with elements each one, followed by a sequence of pairs , . Each and each is between 0 and .
Your program must print the sequence of matrices composed of the read matrix, followed by the resulted matrix of each swap. Notice that print lines with five dashes to separate the matrices, at the beginning and in the end.
Input
4 6 11 22 33 46 15 32 41 33 94 58 71 32 56 23 45 98 21 12 54 15 37 26 17 99 2 3 5 4 0 1 5 4
Output
----- 11 22 33 46 15 32 41 33 94 58 71 32 56 23 45 98 21 12 54 15 37 26 17 99 ----- 11 22 46 33 15 32 41 33 58 94 71 32 56 23 98 45 21 12 54 15 26 37 17 99 ----- 11 22 46 33 32 15 41 33 58 94 32 71 56 23 98 45 12 21 54 15 26 37 99 17 ----- 22 11 46 33 32 15 33 41 58 94 32 71 23 56 98 45 12 21 15 54 26 37 99 17 ----- 22 11 46 33 15 32 33 41 58 94 71 32 23 56 98 45 21 12 15 54 26 37 17 99 -----
Input
3 4 1 0 1 1 0 2 0 3 1 1 9 5
Output
----- 1 0 1 1 0 2 0 3 1 1 9 5 -----
Input
2 2 6 7 8 9 0 1 1 0 0 0 1 1
Output
----- 6 7 8 9 ----- 7 6 9 8 ----- 6 7 8 9 ----- 6 7 8 9 ----- 6 7 8 9 -----
Input
2 1 7 9 0 0 0 0
Output
----- 7 9 ----- 7 9 ----- 7 9 -----