Sarthak and his Magic Grid
Sarthak got an empty magic grid of size $N \times N$ on his birthday. The grid can only be filled with positive integers such that the [bitwise XOR](https://en.wikipedia.org/wiki/Bitwise_operation#XOR) of all numbers from any row, any column, or any of the two main diagonals must all be the same! Can you help Sarthak fill this grid using **only positive integers** no more than $10^9$? ### Input -
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start