Problem E
Sylvester Construction
A Hadamard matrix of order
The Sylvester construction is a way to create a Hadamard
matrix of size
For example:
and so on. In this problem you are required to print a part of a Hadamard matrix constructed in the way described above.
Input
The first number in the input is the number of test cases to
follow. For each test case there are five integers:
Output
For each test case print the sub matrix followed by an empty line.
Sample Input 1 | Sample Output 1 |
---|---|
3 2 0 0 2 2 4 1 1 3 3 268435456 12345 67890 11 12 |
1 1 1 -1 -1 1 -1 1 -1 -1 -1 -1 1 1 -1 -1 1 1 -1 -1 1 1 -1 -1 -1 -1 1 1 -1 -1 1 1 -1 -1 1 1 1 1 -1 -1 -1 -1 1 1 1 1 -1 1 -1 -1 1 -1 1 1 -1 1 -1 1 -1 -1 -1 -1 1 1 1 1 -1 -1 -1 -1 1 -1 1 1 -1 1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 1 1 1 1 1 -1 1 -1 1 -1 1 1 -1 1 -1 -1 1 1 -1 -1 1 1 1 1 -1 -1 1 1 -1 -1 1 1 -1 1 -1 -1 1 -1 -1 -1 1 1 1 1 1 1 1 1 1 -1 1 1 -1 1 -1 1 -1 1 -1 |