{"problem":{"name":"Dash","description":{"content":"On a two-dimensional plane, Takahashi is initially at point $(0, 0)$, and his initial health is $H$. $M$ items to recover health are placed on the plane; the $i$\\-th of them is placed at $(x_i,y_i)$. ","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc303_c"},"statements":[{"statement_type":"Markdown","content":"On a two-dimensional plane, Takahashi is initially at point $(0, 0)$, and his initial health is $H$. $M$ items to recover health are placed on the plane; the $i$\\-th of them is placed at $(x_i,y_i)$.\nTakahashi will make $N$ moves. The $i$\\-th move is as follows.\n\n1.  Let $(x,y)$ be his current coordinates. He consumes a health of $1$ to move to the following point, depending on $S_i$, the $i$\\-th character of $S$:\n    *   $(x+1,y)$ if $S_i$ is `R`;\n    *   $(x-1,y)$ if $S_i$ is `L`;\n    *   $(x,y+1)$ if $S_i$ is `U`;\n    *   $(x,y-1)$ if $S_i$ is `D`.\n2.  If Takahashi's health has become negative, he collapses and stops moving. Otherwise, if an item is placed at the point he has moved to, and his health is strictly less than $K$, then he consumes the item there to make his health $K$.\n    \n\nDetermine if Takahashi can complete the $N$ moves without being stunned.\n\n## Constraints\n\n*   $1\\leq N,M,H,K\\leq 2\\times 10^5$\n*   $S$ is a string of length $N$ consisting of `R`, `L`, `U`, and `D`.\n*   $|x_i|,|y_i| \\leq 2\\times 10^5$\n*   $(x_i, y_i)$ are pairwise distinct.\n*   All values in the input are integers, except for $S$.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$ $M$ $H$ $K$\n$S$\n$x_1$ $y_1$\n$\\vdots$\n$x_M$ $y_M$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc303_c","tags":[],"sample_group":[["4 2 3 1\nRUDL\n-1 -1\n1 0","Yes\n\nInitially, Takahashi's health is $3$. We describe the moves below.\n\n*   $1$\\-st move: $S_i$ is `R`, so he moves to point $(1,0)$. His health reduces to $2$. Although an item is placed at point $(1,0)$, he do not consume it because his health is no less than $K=1$.\n    \n*   $2$\\-nd move: $S_i$ is `U`, so he moves to point $(1,1)$. His health reduces to $1$.\n    \n*   $3$\\-rd move: $S_i$ is `D`, so he moves to point $(1,0)$. His health reduces to $0$. An item is placed at point $(1,0)$, and his health is less than $K=1$, so he consumes the item to make his health $1$.\n    \n*   $4$\\-th move: $S_i$ is `L`, so he moves to point $(0,0)$. His health reduces to $0$.\n    \n\nThus, he can make the $4$ moves without collapsing, so `Yes` should be printed. Note that the health may reach $0$."],["5 2 1 5\nLDRLD\n0 0\n-1 -1","No\n\nInitially, Takahashi's health is $1$. We describe the moves below.\n\n*   $1$\\-st move: $S_i$ is `L`, so he moves to point $(-1,0)$. His health reduces to $0$.\n    \n*   $2$\\-nd move: $S_i$ is `D`, so he moves to point $(-1,-1)$. His health reduces to $-1$. Now that the health is $-1$, he collapses and stops moving.\n    \n\nThus, he will be stunned, so `No` should be printed.\nNote that although there is an item at his initial point $(0,0)$, he does not consume it before the $1$\\-st move, because items are only consumed after a move."]],"created_at":"2026-03-03 11:01:13"}}