{"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":"给你一个正整数n.\u003c/br\u003e\n以及一个整数序列a[1..n].\u003c/br\u003e\n现在,你需要决定是否要在a[i]和a[i+1](这里1\u003c\u003di\u003c\u003dn-1)切割一次,使得这个序列分成若干个序列。\u003c/br\u003e\n且要求,全部切割完以后,每个序列中,奇数和偶数出现的次数都是一样的.\u003c/br\u003e\n如{1,2,3,4}可以切割一次变成{1,2}{3,4}两个序列,且每个序列中奇数和偶数出现的次数都是一样的为1.\u003c/br\u003e\n每切割一次的代价是|a[i]-a[i+1]|.\u003c/br\u003e\n问你在不超过B代价的情况下,你最多能对这个序列切割几次?\n"}},{"title":"Input","value":{"format":"HTML","content":"输入的第一行为两个整数n(2\u003c\u003dn\u003c\u003d100),B(1\u003c\u003dB\u003c\u003d100).\u003c/br\u003e\n第二行n个整数,表示a[1..n](1\u003c\u003dai\u003c\u003d100).\u003c/br\u003e\n\u003cstrong\u003e保证初始序列中,奇数和偶数出现的次数都是一样的。\u003c/strong\u003e"}},{"title":"Output","value":{"format":"HTML","content":"输出只有一个整数,表示最多能对这个序列切割的次数."}},{"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样例输入1\n \u003c/div\u003e\n \u003cpre\u003e6 4\u003cbr\u003e1 2 5 10 15 20\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n样例输出1\n \u003c/div\u003e\n \u003cpre\u003e1\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n样例输入2\n \u003c/div\u003e\n \u003cpre\u003e4 10\u003cbr\u003e1 3 2 4\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n样例输出2\n \u003c/div\u003e\n \u003cpre\u003e0\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n样例输入3\n \u003c/div\u003e\n \u003cpre\u003e6 100\u003cbr\u003e1 2 3 4 5 6\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n样例输出3\n \u003c/div\u003e\n \u003cpre\u003e2\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}},{"title":"样例解释","value":{"format":"HTML","content":"第一个样例,原序列可以切割1次,分割成{1 2},{5 10 15 20}代价为3\u003c\u003d4\u003c/br\u003e\n第二个样例,原序列不能在不超过B的情况下进行任意一次合法的切割.\u003c/br\u003e\n第三个样例,原序列可以切割2次,分割成{1 2} {3 4} {5 6},代价为1+1\u003d2\u003c\u003d100"}},{"title":"提示","value":{"format":"HTML","content":"考虑什么位置才能进行切割?"}}]}