{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eThe governor of Yekaterinozavodsk region had to deal with ambassadors from one \r\nof the nearby states\u0026nbsp;— Square country. All square inhabitants of this country \r\nloved the squares of integers. So, they declared to the governor that \r\nthey would build a square metropolitan from Yekaterinozavodsk to one of the \r\nsuburbs only if he would be able to fill a rectangular table \u003ci\u003eN\u003c/i\u003e\u0026nbsp;×\u0026nbsp;\u003ci\u003eM\u003c/i\u003e with \r\nsquares of different positive integers in such a way, that the sum of numbers \r\nin each row and in each column would also be a square. The governor wasn\u0027t a \r\nsquare man, and also he wasn\u0027t good in maths, so he asked for your help.\r\n\u003c/div\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eThe first line contains an integer \u003ci\u003eT\u003c/i\u003e\u0026nbsp;— the number of test cases \r\n(1\u0026nbsp;≤\u0026nbsp;\u003ci\u003eT\u003c/i\u003e\u0026nbsp;≤\u0026nbsp;20). The following \u003ci\u003eT\u003c/i\u003e lines contain the pairs of integers \u003ci\u003eN\u003c/i\u003e and \u003ci\u003eM\u003c/i\u003e \r\n(1\u0026nbsp;≤\u0026nbsp;\u003ci\u003eN\u003c/i\u003e,\u0026nbsp;\u003ci\u003eM\u003c/i\u003e\u0026nbsp;≤\u0026nbsp;20).\r\n\u003c/div\u003e\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eFor each test case output the required table: \u003ci\u003eN\u003c/i\u003e lines with \u003ci\u003eM\u003c/i\u003e numbers \r\nin each line. All numbers in the table shouldn\u0027t exceed 10\u003csup\u003e17\u003c/sup\u003e. If there is no \r\nsuch table, output −1. Answers for different test cases should be delimited \r\nwith an empty line.\r\n\u003c/div\u003e\u003c/div\u003e"}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3\r\n1 2\r\n3 1\r\n2 2\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e9 16\r\n\r\n1024\r\n25\r\n274576\r\n\r\n4761 8464\r\n627264 1115136\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}