{"trustable":true,"prependHtml":"\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 async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003e Director Zheng is not the main director\u003cbr\u003e Nor is he the deputy director\u003cbr\u003e He is not a director at all\u003cbr\u003e In fact\u003cbr\u003e He is the leader of the soldiers in battle\u003cbr\u003e\u003cbr\u003e One day, Director Zheng brought his army to a plain of size n*m to prepare for battle formation.\u003cbr\u003e Based on past battle experience, each soldier can attack and can only attack positions with a Manhattan distance of 2, including the position where the soldier is located. Of course, a soldier cannot stand in a position that another soldier can attack, and due to the terrain, not every position on the plain can be arranged for a soldier.\u003cbr\u003e Now, given the values of n and m, as well as the specific terrain of the plain, please help Director Zheng calculate the maximum number of soldiers that can be arranged on the battlefield.\u003cbr\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The input contains multiple sets of test data;\u003cbr\u003eFor each set of data, the first line contains 2 integers n and m (n \u0026lt;\u003d 100, m \u0026lt;\u003d 10 ), separated by a space;\u003cbr\u003eFollowing are n lines, each with m numbers, representing an n*m rectangular battlefield, where 1 indicates that a soldier can be arranged at that position, and 0 indicates that the terrain does not allow for a soldier to be arranged.\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"Please calculate and output the maximum number of soldiers that can be arranged for each set of data, with each set of data output on a separate line.\u003cbr\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\u003e6 6\r\n0 0 0 0 0 0\r\n0 0 0 0 0 0\r\n0 0 1 1 0 0\r\n0 0 0 0 0 0\r\n0 0 0 0 0 0\r\n0 0 0 0 0 0\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}