Given :
Matrix consist of $n$ rows and m columns
For each row the xor of all elements in that row (suppose if there are 5 rows in a matrix then 5 numbers will be given representing the xor of each row)
For each column the xor of all element in that column
Task:
If it is possible to form a matrix then print the elements of that matrix
I found this in the editorial
If $a_1\oplus a_2 \oplus\cdots\oplus a_n\neq b_1 \oplus b2 \oplus\cdots\oplus b_m$ , then there is no suitable matrix. The operation means xor.
Otherwise, we can always construct a suitable matrix by the following method: the first element of the first line will be equal to `$a_1 \oplus b_2 \oplus b_3 \oplus\cdots\oplus b_m$. The second element of the first line is $b_2$, the third element is $b_3$, the last one is $b_m$.
The first element of the second line will be $a_2$, the first element of the third line is $a_3$, the first element of the last line is an. The rest of the elements will be zero.
It is not difficult to verify that the matrix obtained satisfies all the restrictions.
I tried reading https://codeforces.com/contest/1016/problem/D , but I didn't understand how the elements of matrix are calculated. Please can someone explain it with example.