Can the solution bellow be applied (with small modification) to the general case of N x N? (Solution in One Note).
#### BTW: use dark mode for better reading. 1816B - Grid Reconstruction
Solution
I did think about adding a "virtual" row and/or column to make matrix even by even, and saying that values of positions are 0, so the answer will (maybe?) not be affected.
link to problem: https://codeforces.me/problemset/problem/1816/B