{"trustable":false,"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":"cyw同学在玩消消乐的游戏,游戏规则非常简单,cyw同学仅可以消除@字符所在区域。而一次消除操作可以消除相连着的一整块的@(相连是指 8个方向,横向相邻、纵向相邻或对角相邻)。\n\n给你一个游戏区域,请问cyw同学需要进行多少次消除操作才可以消灭全部的@呢?"}},{"title":"Input","value":{"format":"HTML","content":"多组数据读入,每组数据在第一行给出两个整数 n 和 m,表示行和列,1≤n,m≤100.\n\u003cbr\u003e如果 m \u003d 0表示输入的结束,接下来是 n 行,每行 m 个字符。每个字符要么是\u0027*\u0027,要么是\u0027@\u0027。"}},{"title":"Output","value":{"format":"HTML","content":"对于每一个游戏区域,在一行输出进行消灭操作的数量,每个结果输出占一行。\n\n\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\u003e\u003cpre\u003e1 1\n*\n3 5\n*@*@*\n**@**\n*@*@*\n1 8\n@@****@*\n5 5 \n****@\n*@@*@\n*@**@\n@@@*@\n@@**@\n0 0 \n\u003c/pre\u003e\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e\u003cpre\u003e0\n1\n2\n2\n\u003c/pre\u003e\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}