> For the complete documentation index, see [llms.txt](https://solutions.icpc.uclaacm.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://solutions.icpc.uclaacm.com/2021-tryout-solutions/tryout-1/b-mirror-images.md).

# B: Mirror Images

https\://open.kattis.com/problems/mirror

We need to reflect a matrix twice: once left-to-right and once top-to-bottom.

To reflect left-to-right, `M[i][j]` becomes `M[i][c-1-j]`.

To reflect top-to-bottom, `M[i][j]` becomes `M[r-1-i][j]`.

So, we want to translate all elements in the input matrix `M[i][j]` to `M[r-1-i][c-1-j]`.

We can do this while reading input:

```
vector<vector<char>> M(r, vector<char>(c));
for (int i = 0; i < r; i++) {
    string s;
    cin >> s;
    for (int j = 0; j < c; j++) {
        M[r-1-i][c-1-j] = s.at(j);
    }
}
```
