{"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":"MD","content":"\u003cp\u003e凡凡找到了新的修音师,他可以唱更电的电音了!两人约在宽面店见面,他们想选择一个能够花费总时间最少的宽面店见面。现在你知道他们都在一个$n \\times m$的地图中,每次可以走到相邻的格子上,走一格要花费$11$分钟,问两人能够花费最短的时间。\u003c/p\u003e\n"}},{"title":"输入格式","value":{"format":"MD","content":"\u003cp\u003e输入包含多组测试案例。每个测试案例第一行给出前两个整数$n,m(2\\le n, m\\le 200)$。\n接下来的$n$行,每行包含$m$个字符。“Y”表示凡凡的初始位置,“M”表示修音师初始位置,“#”死路,\u0027.\u0027表示可走的路,“@”表示 宽面店。\u003c/p\u003e\n\u003cb\u003e注意:输入包含多组测试案例,且不确定有多少组\u003c/b\u003e\n"}},{"title":"输出格式","value":{"format":"MD","content":"\u003cp\u003e对于每个测试用例,在一行输出凡凡和修音师花费的最短总时间\u003c/p\u003e\n\u003cb\u003e每行输出末尾不能有多余空格。\u003c/b\u003e\n"}},{"title":"输入样例","value":{"format":"MD","content":"\u003cpre\u003e4 4\nY.#@\n....\n.#..\n@..M\n4 4\nY.#@\n....\n.#..\n@#.M\n5 5\nY..@.\n.#...\n.#...\n@..M.\n#...#\u003c/pre\u003e"}},{"title":"输出样例","value":{"format":"MD","content":"66\n88\n66"}}]}