{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003ch2\u003eJ: \u003c/h2\u003e\n\n\u003ch3\u003eProblem Statement\u003c/h3\u003e\n\u003cp\u003eYou are given a positive integer \u003cvar\u003eN\u003c/var\u003e. Your task is to determine if there exists a square matrix \u003cvar\u003eA\u003c/var\u003e whose dimension is \u003cvar\u003eN\u003c/var\u003e that satisfies the following conditions and provide an example of such matrices if it exists. \u003cvar\u003eA_{i, j}\u003c/var\u003e denotes the element of matrix \u003cvar\u003eA\u003c/var\u003e at the \u003cvar\u003ei\u003c/var\u003e-th row and \u003cvar\u003ej\u003c/var\u003e-th column.\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e For all \u003cvar\u003ei, j\u003c/var\u003e \u003cvar\u003e(1 \\leq i, j \\leq N)\u003c/var\u003e, \u003cvar\u003eA_{i, j}\u003c/var\u003e is an integer that satisfies \u003cvar\u003e1 \\leq A_{i, j} \\leq 2N - 1\u003c/var\u003e.\u003c/li\u003e\n\u003cli\u003e For all \u003cvar\u003ek \u003d 1, 2, ..., N\u003c/var\u003e, a set consists of \u003cvar\u003e2N - 1\u003c/var\u003e elements from the \u003cvar\u003ek\u003c/var\u003e-th row or \u003cvar\u003ek\u003c/var\u003e-th column is \u003cvar\u003e\\{1, 2, ..., 2N - 1\\}\u003c/var\u003e.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eIf there are more than one possible matrices, output any of them.\u003c/p\u003e\n\n\u003ch3\u003eInput\u003c/h3\u003e\n\u003cpre\u003e\u003cvar\u003eN\u003c/var\u003e\u003c/pre\u003e\n\n\u003cp\u003eInput consists of one line, which contains the integer \u003cvar\u003eN\u003c/var\u003e that is the size of a square matrix to construct.\u003c/p\u003e\n\n\u003ch3\u003eConstraint\u003c/h3\u003e\n\u003cul\u003e\n\u003cli\u003e \u003cvar\u003eN\u003c/var\u003e is an integer that satisfies \u003cvar\u003e1 \\leq N \\leq 500\u003c/var\u003e.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003ch3\u003eOutput\u003c/h3\u003e\n\u003cp\u003eOutput \u003ccode\u003eNo\u003c/code\u003e in a single line if such a square matrix does not exist.\u003c/p\u003e\n\n\u003cp\u003eIf such a square matrix \u003cvar\u003eA\u003c/var\u003e exists, output \u003ccode\u003eYes\u003c/code\u003e on the first line and \u003cvar\u003eA\u003c/var\u003e after that. More specifically, follow the following format.\u003c/p\u003e\n\n\u003cpre\u003eYes\n\u003cvar\u003eA_{1, 1}\u003c/var\u003e \u003cvar\u003eA_{1, 2}\u003c/var\u003e \u003cvar\u003e...\u003c/var\u003e \u003cvar\u003eA_{1, N}\u003c/var\u003e\n\u003cvar\u003eA_{2, 1}\u003c/var\u003e \u003cvar\u003eA_{2, 2}\u003c/var\u003e \u003cvar\u003e...\u003c/var\u003e \u003cvar\u003eA_{2, N}\u003c/var\u003e\n\u003cvar\u003e:\u003c/var\u003e\n\u003cvar\u003eA_{N, 1}\u003c/var\u003e \u003cvar\u003eA_{N, 2}\u003c/var\u003e \u003cvar\u003e...\u003c/var\u003e \u003cvar\u003eA_{N, N}\u003c/var\u003e\n\u003c/pre\u003e\n\n\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\u003e4\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYes\n2 6 3 7\n4 5 2 1\n1 7 5 6\n5 3 4 2\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n\n\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\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eNo\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n"}}]}