Problem D. Square Country 3
时间限制 500 ms
内存限制 64 MB
The governor of Yekaterinozavodsk region had to deal with ambassadors from one of the nearby states — Square country. All square inhabitants of this country loved the squares of integers. So, they declared to the governor that they would build a square metropolitan from Yekaterinozavodsk to one of the suburbs only if he would be able to fill a rectangular table
N ×
M with squares of different positive integers in such a way, that the sum of numbers in each row and in each column would also be a square. The governor wasn't a square man, and also he wasn't good in maths, so he asked for your help.
输入数据
输出数据
For each test case output the required table:
N lines with
M numbers in each line. All numbers in the table shouldn't exceed 10
17. If there is no such table, output −1. Answers for different test cases should be delimited with an empty line.
样例
$ Mathjax font initiator $