{"raw_statement":[{"iden":"problem statement","content":"There are positive integers $N, M$, and an $N \\times M$ positive integer matrix $A_{i, j}$. For two **(strictly) increasing** positive integer sequences $X = (X_1, \\ldots, X_N)$ and $Y = (Y_1, \\ldots, Y_M)$, we define the penalty $D(X, Y)$ as $\\max_{1 \\leq i \\leq N, 1 \\leq j \\leq M} |X_i Y_j - A_{i, j}|$.\nFind two **(strictly) increasing** positive integer sequences $X$ and $Y$ such that $D(X, Y)$ is the smallest possible."},{"iden":"constraints","content":"*   $1 \\leq N, M \\leq 5$\n*   $1 \\leq A_{i, j} \\leq 10^9$ ($1 \\leq i \\leq N$, $1 \\leq j \\leq M$)\n*   All values in the input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $M$\n$A_{1,1}$ $\\ldots$ $A_{1,M}$\n$\\vdots$\n$A_{N,1}$ $\\ldots$ $A_{N,M}$"},{"iden":"sample input 1","content":"1 1\n853922530"},{"iden":"sample output 1","content":"0\n31415\n27182"},{"iden":"sample input 2","content":"3 3\n4 4 4\n4 4 4\n4 4 4"},{"iden":"sample output 2","content":"5\n1 2 3 \n1 2 3"},{"iden":"sample input 3","content":"3 4\n4674 7356 86312 100327\n8737 11831 145034 167690\n47432 66105 809393 936462"},{"iden":"sample output 3","content":"357\n129 216 1208 \n39 55 670 775"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}