{"problem":{"name":"Snuke's Kyoto Trip","description":{"content":"You are given integers $W,H,L,R,D,U$. A town of Kyoto is on the two-dimensional plane. In the town, there is exactly one block at each lattice point $(x,y)$ that satisfies all of the following conditi","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc192_e"},"statements":[{"statement_type":"Markdown","content":"You are given integers $W,H,L,R,D,U$.\nA town of Kyoto is on the two-dimensional plane.\nIn the town, there is exactly one block at each lattice point $(x,y)$ that satisfies all of the following conditions. There are no blocks at any other points.\n\n*   $0\\leq x\\leq W$\n*   $0\\leq y\\leq H$\n*   $x<L$ or $R<x$ or $y<D$ or $U<y$\n\nSnuke traveled through the town as follows.\n\n*   First, he chooses one block and stands there.\n*   Then, he performs the following operation any number of times (possibly zero):\n    *   Move one unit in the positive direction of the $x$\\-axis or the positive direction of the $y$\\-axis. However, the point after moving must also have a block.\n\nPrint the number, modulo $998244353$, of possible paths that Snuke could have taken.\n\n## Constraints\n\n*   $0\\leq L\\leq R\\leq W\\leq 10^6$\n*   $0\\leq D\\leq U\\leq H\\leq 10^6$\n*   There is at least one block.\n*   All input values are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$W$ $H$ $L$ $R$ $D$ $U$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc192_e","tags":[],"sample_group":[["4 3 1 2 2 3","192\n\nThe following are examples of possible paths. Here, a path is represented by listing the lattice points visited in order.\n\n*   $(3,0)$\n*   $(0,0)\\rightarrow (1,0)\\rightarrow (2,0)\\rightarrow (2,1)\\rightarrow (3,1)\\rightarrow (3,2)\\rightarrow (4,2)\\rightarrow (4,3)$\n*   $(0,1)\\rightarrow (0,2)$\n\nThere are $192$ possible paths."],["10 12 4 6 8 11","4519189"],["192 25 0 2 0 9","675935675\n\nDo not forget to print the number of paths modulo $998244353$."]],"created_at":"2026-03-03 11:01:14"}}