{"problem":{"name":"Manhattan Cafe","description":{"content":"In an $N$\\-dimensional space, the Manhattan distance $d(x,y)$ between two points $x=(x_1, x_2, \\dots, x_N)$ and $y = (y_1, y_2, \\dots, y_N)$ is defined by: $\\displaystyle d(x,y)=\\sum_{i=1}^n \\vert x_","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":6000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc265_f"},"statements":[{"statement_type":"Markdown","content":"In an $N$\\-dimensional space, the Manhattan distance $d(x,y)$ between two points $x=(x_1, x_2, \\dots, x_N)$ and $y = (y_1, y_2, \\dots, y_N)$ is defined by:\n\n$\\displaystyle d(x,y)=\\sum_{i=1}^n \\vert x_i - y_i \\vert.$\n\nA point $x=(x_1, x_2, \\dots, x_N)$ is said to be a lattice point if the components $x_1, x_2, \\dots, x_N$ are all integers.\nYou are given lattice points $p=(p_1, p_2, \\dots, p_N)$ and $q = (q_1, q_2, \\dots, q_N)$ in an $N$\\-dimensional space.  \nHow many lattice points $r$ satisfy $d(p,r) \\leq D$ and $d(q,r) \\leq D$? Find the count modulo $998244353$.\n\n## Constraints\n\n*   $1 \\leq N \\leq 100$\n*   $0 \\leq D \\leq 1000$\n*   $-1000 \\leq p_i, q_i \\leq 1000$\n*   All values in input are integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$ $D$ \n$p_1$ $p_2$ $\\dots$ $p_N$\n$q_1$ $q_2$ $\\dots$ $q_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc265_f","tags":[],"sample_group":[["1 5\n0\n3","8\n\nWhen $N=1$, we consider points in a one-dimensional space, that is, on a number line.  \n$8$ lattice points satisfy the conditions: $-2,-1,0,1,2,3,4,5$."],["3 10\n2 6 5\n2 1 2","632"],["10 100\n3 1 4 1 5 9 2 6 5 3\n2 7 1 8 2 8 1 8 2 8","145428186"]],"created_at":"2026-03-03 11:01:14"}}