{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cpre\u003e\n给定一个n*m的矩阵,每次操作可以任选其中一个数,把它的值加一。\n请问最少需要多少次能够把原矩阵变成素数矩阵。\n素数矩阵的定义是:存在一行全是素数或者一列全是素数。\n\u003c/pre\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cpre\u003e\n第一行两个正整数n和m。\n接下来n行,每行m个数,表示矩阵里初始的每一个数aij。\n其中1\u003c\u003dn,m\u003c\u003d500,1\u003c\u003daij\u003c\u003d1e5\n\u003c/pre\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cpre\u003e\n最少需要多少次能够把原矩阵变成素数矩阵。\n\u003c/pre\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003cpre\u003e\nSample Input1:\n3 3\n1 2 3\n5 6 1\n4 4 1\nSample Output1:\n1\nSample Input2:\n2 2\n1 3\n4 2\nSample Output2:\n0\nSample Input3:\n2 3\n4 8 8\n9 2 9\nSample Output3:\n3\n\u003c/pre\u003e"}}]}