Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Sarthak got an empty magic grid of size N×NN×N on his birthday. The grid can only be filled with positive integers such that the bitwise 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 109109?
For each test case, output NN lines, each containing NN space-separated integers, such that the grid satisfies the condition given in the statement.
Each integer should be positive and ≤109≤109.
1
3
1 1 1
1 1 1
1 1 1
The bitwise XOR of all rows, columns and main diagonals in the grid is 11. Therefore, this satisfies the condition.
In our experience, we suggest you solve this Sarthak and his Magic Grid CodeChef Solution and gain some new skills from Professionals completely free and we assure you will be worth it.
Sarthak and his Magic Grid Problem is available on Hacker Rank for Free, if you are stuck anywhere between a compilation, just visit Queslers to get Sarthak and his Magic Grid CodeChef Solution.
I hope this Sarthak and his Magic Grid CodeChef Solution would be useful for you to learn something new from this problem. If it helped you then don’t forget to bookmark our site for more Hacker Rank, Leetcode, Codechef, Codeforce Solution.
This Problem is intended for audiences of all experiences who are interested in learning about Data Science in a business context; there are no prerequisites.
Keep Learning!
More on Queslers >>