{"raw_statement":[{"iden":"problem statement","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$."},{"iden":"constraints","content":"*   $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."},{"iden":"input","content":"Input 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$"},{"iden":"sample input 1","content":"1 5\n0\n3"},{"iden":"sample output 1","content":"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$."},{"iden":"sample input 2","content":"3 10\n2 6 5\n2 1 2"},{"iden":"sample output 2","content":"632"},{"iden":"sample input 3","content":"10 100\n3 1 4 1 5 9 2 6 5 3\n2 7 1 8 2 8 1 8 2 8"},{"iden":"sample output 3","content":"145428186"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}