{"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":"\u003cp\u003e你正在玩一个电脑游戏。其中的一个关卡将你置于一个迷宫中,该迷宫由 $$$n$$$ 行组成,每行包含 $$$m$$$ 个单元格。每个单元格要么是空的,要么被障碍物占据。起始单元格位于第 $$$r$$$ 行第 $$$c$$$ 列。在每一步中,你可以向上、向左、向下或向右移动一个单元格,前提是目标单元格不被障碍物占据。你不能移动超出迷宫的边界。\u003c/p\u003e\n\n\u003cp\u003e不幸的是,你的键盘即将坏掉,因此你向左移动的次数不能超过 $$$x$$$ 次,向右移动的次数不能超过 $$$y$$$ 次。向上和向下的移动次数没有限制,因为用于向上和向下移动的按键状态良好。\u003c/p\u003e\n\n\u003cp\u003e现在,你想确定:对于每个单元格,是否存在一系列移动,可以将你从起始单元格移动到这个特定的单元格。棋盘上有多少个单元格具有这种属性?\u003c/p\u003e"}},{"title":"输入","value":{"format":"HTML","content":"\u003cp\u003e第一行包含两个整数 $$$n,m$$$ $$$(1 \\leq n, m \\leq 2000)$$$,分别表示迷宫中的行数、列数。\u003c/p\u003e\n\n\u003cp\u003e第二行包含两个整数 $$$r,c$$$ $$$(1 \\leq r \\leq n,~1 \\leq c \\leq m)$$$,分别表示起始单元格的行下标、列下标。\u003c/p\u003e\n\n\u003cp\u003e第三行包含两个整数 $$$x,y$$$ $$$(0 \\leq x,y \\leq 10^9)$$$,分别表示允许向左、允许向右的最大移动次数。\u003c/p\u003e\n\n\u003cp\u003e接下来的 $$$n$$$ 行描述了迷宫。每行的长度为 $$$m$$$,只包含符号 \u003ccode\u003e.\u003c/code\u003e 和 \u003ccode\u003e*\u003c/code\u003e。第 $$$i$$$ 行第 $$$j$$$ 个字符,对应于迷宫中第 $$$i$$$ 行第 $$$j$$$ 列的单元格。符号 \u003ccode\u003e.\u003c/code\u003e 表示空白的单元格,而符号 \u003ccode\u003e*\u003c/code\u003e 表示带有障碍物的单元格。\u003c/p\u003e\n\n\u003cp\u003e保证起始单元格不包含障碍物。\u003c/p\u003e"}},{"title":"输出","value":{"format":"HTML","content":"\u003cp\u003e输出一个整数:迷宫中从起始单元格开始,可到达的单元格数量,包括起始单元格本身。\u003c/p\u003e"}},{"title":"示例","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\u003e4 5\n3 2\n1 2\n.....\n.***.\n...**\n*....\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e10\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}},{"title":"","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\u003e4 4\n2 2\n0 1\n....\n..*.\n....\n....\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e7\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}},{"title":"注意","value":{"format":"HTML","content":"\u003cp\u003e在相应的示例中,可到达的单元格用 \u003ccode\u003e+\u003c/code\u003e 标记。\u003c/p\u003e\n\n\u003cp\u003e第一个示例: \u003c/p\u003e\n\u003ccenter\u003e \u003cpre class\u003d\"verbatim\"\u003e\u003cbr\u003e+++..\u003cbr\u003e+***.\u003cbr\u003e+++**\u003cbr\u003e*+++.\u003cbr\u003e\u003c/pre\u003e \u003c/center\u003e\n\n\u003cp\u003e第二个示例: \u003c/p\u003e\n\u003ccenter\u003e \u003cpre class\u003d\"verbatim\"\u003e\u003cbr\u003e.++.\u003cbr\u003e.+*.\u003cbr\u003e.++.\u003cbr\u003e.++.\u003cbr\u003e\u003c/pre\u003e \u003c/center\u003e"}}]}