{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e现有一个包含 \u003cb\u003en\u003c/b\u003e 个整数的序列 \u003cb\u003ea\u003csub\u003e1\u003c/sub\u003e, a\u003csub\u003e2\u003c/sub\u003e, ..., a\u003csub\u003en\u003c/sub\u003e\u003c/b\u003e,和一个包含 \u003cb\u003em\u003c/b\u003e 个整数的序列 \u003cb\u003eb\u003csub\u003e1\u003c/sub\u003e, b\u003csub\u003e2\u003c/sub\u003e, ..., b\u003csub\u003em\u003c/sub\u003e\u003c/b\u003e。\u003c/p\u003e \n\u003cp\u003e 问 \u003cb\u003ea\u003c/b\u003e 序列中有多少个连续子序列,令每个数同时加上某个整数(可以为负数)后,与 \u003cb\u003eb\u003c/b\u003e 序列相同?\u003c/p\u003e "}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e第一行包含两个整数 \u003cb\u003en\u003c/b\u003e, \u003cb\u003em\u003c/b\u003e (\u003cb\u003e1 \u0026leq; n, m \u0026leq; 2 \u0026times; 10\u003csup\u003e5\u003c/sup\u003e\u003c/b\u003e),表示数组 \u003cb\u003ea\u003c/b\u003e 与数组 \u003cb\u003eb\u003c/b\u003e 的长度。\u003c/p\u003e\n\u003cp\u003e第二行包含 \u003cb\u003en\u003c/b\u003e 个整数 \u003cb\u003ea\u003csub\u003e1\u003c/sub\u003e\u003c/b\u003e, \u003cb\u003ea\u003csub\u003e2\u003c/sub\u003e\u003c/b\u003e, ..., \u003cb\u003ea\u003csub\u003en\u003c/sub\u003e\u003c/b\u003e (\u003cb\u003e1 \u0026leq; a\u003csub\u003ei\u003c/sub\u003e \u0026leq; 10\u003csup\u003e9\u003c/sup\u003e\u003c/b\u003e)。\n\u003cp\u003e第三行包含 \u003cb\u003em\u003c/b\u003e 个整数 \u003cb\u003eb\u003csub\u003e1\u003c/sub\u003e\u003c/b\u003e, \u003cb\u003eb\u003csub\u003e2\u003c/sub\u003e\u003c/b\u003e, ..., \u003cb\u003eb\u003csub\u003em\u003c/sub\u003e\u003c/b\u003e (\u003cb\u003e1 \u0026leq; b\u003csub\u003ei\u003c/sub\u003e \u0026leq; 10\u003csup\u003e9\u003c/sup\u003e\u003c/b\u003e)。"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e输出一个整数,表示满足条件的区间个数。\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003cdiv class\u003d\"sample-test\"\u003e \n \u003cdiv class\u003d\"input\"\u003e \n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e \n \u003cpre\u003e13 5\u003cbr\u003e2 4 5 5 4 3 2 2 2 3 3 2 1\u003cbr\u003e3 4 4 3 2\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e \n \u003cdiv class\u003d\"output\"\u003e \n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e \n \u003cpre\u003e2\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003e下图表示了两个可行的子区间,左侧阴影部分为 \u003cb\u003eb\u003c/b\u003e 序列,右侧的上边界为 \u003cb\u003ea\u003c/b\u003e 序列。\u003c/p\u003e \n\u003ccenter\u003e \n \u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/4ef372e137000b53da2bc4ca9d7daeee?v\u003d1596950668\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e \n\u003c/center\u003e"}}]}