{"problem":{"name":"Octopus","description":{"content":"There is an octopus-shaped robot and $N$ treasures on a number line. The $i$\\-th treasure $(1\\leq i\\leq N)$ is located at coordinate $X_i$.   The robot has one head and $N$ legs, and the $i$\\-th leg $","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc318_f"},"statements":[{"statement_type":"Markdown","content":"There is an octopus-shaped robot and $N$ treasures on a number line. The $i$\\-th treasure $(1\\leq i\\leq N)$ is located at coordinate $X_i$.  \nThe robot has one head and $N$ legs, and the $i$\\-th leg $(1\\leq i\\leq N)$ has a length of $L_i$.\nFind the number of **integers** $k$ such that the robot can grab all $N$ treasures as follows.\n\n*   Place the head at coordinate $k$.\n*   Repeat the following for $i=1,2,\\ldots,N$ in this order: if there is a treasure that has not been grabbed yet within a distance of $L_i$ from the head, that is, at a coordinate $x$ satisfying $k-L_i\\leq x\\leq k+L_i$, choose one such treasure and grab it.\n\n## Constraints\n\n*   $1 \\leq N\\leq 200$\n*   $-10^{18} \\leq X_1<X_2<\\cdots<X_N\\leq 10^{18}$\n*   $1\\leq L_1\\leq L_2\\leq\\cdots\\leq L_N\\leq 10^{18}$\n*   All input values are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$\n$X_1$ $X_2$ $\\ldots$ $X_N$\n$L_1$ $L_2$ $\\ldots$ $L_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc318_f","tags":[],"sample_group":[["3\n-6 0 7\n3 5 10","6\n\n$k=-3,-2,-1,2,3,4$ satisfy the condition. For example, when $k=-3$, the robot can grab all three treasures as follows.\n\n*   The first leg can grab treasures at coordinates $x$ satisfying $-6\\leq x\\leq 0$. Among them, grab the first treasure at coordinate $-6$.\n*   The second leg can grab treasures at coordinates $x$ satisfying $-8\\leq x\\leq 2$. Among them, grab the second treasure at coordinate $0$.\n*   The third leg can grab treasures at coordinates $x$ satisfying $-13\\leq x\\leq 7$. Among them, grab the third treasure at coordinate $7$."],["1\n0\n1000000000000000000","2000000000000000001\n\nAll integers $k$ from $-10^{18}$ to $10^{18}$ satisfy the condition."],["2\n-100 100\n1 1","0\n\nNo $k$ satisfies the conditions."]],"created_at":"2026-03-03 11:01:14"}}