{"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\n\u003cp\u003e你拥有n个物品和m个盒子,每个盒子的大小正好是k。物品从左到右依次从1到n编号,第i个物体的大小是ai。\u003c/p\u003e\n\n\u003cp\u003e你想把物品装进盒子里,使用以下算法:一个空盒子,从左到右遍历物体,如果第i个物品适合当前盒子(即盒子的剩余大小大于或等于ai),他把它放在盒子里,盒子的剩余大小减少了ai。否则,他将拿新的空盒子并继续上述过程。\u003c/p\u003e\n\n\u003cp\u003e你希望通过上述算法知道他可以打包的最多物品。为了达到这个目标,他可以从集合中丢弃最左边的物品,直到剩下的所有物品都可以打包在他拥有的盒子中。\u003c/p\u003e\n\u003cp\u003e计算可以在盒子里装入的最多物品数量。\u003c/p\u003e\n"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e输入的第一行包含三个整数n,m,k(1≤n,m≤2⋅1e5,1≤k≤1e9) - 物品的数量,盒子的数量和每个盒子的大小。\u003c/p\u003e\n\n\u003cp\u003e输入的第二行包含n个整数a1,a2,...,a(1≤ai≤k),其中ai是第i个物品的大小。\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e输出可以在盒子里装入的最多物品数量。\u003c/p\u003e"}},{"title":"Sample In 1","value":{"format":"HTML","content":"\u003cpre\u003e5 2 6\u003cbr\u003e5 2 1 4 2\u003cbr\u003e\u003c/pre\u003e\n"}},{"title":"Sample Out 1","value":{"format":"HTML","content":"4"}},{"title":"Sample In 2","value":{"format":"HTML","content":"\u003cpre\u003e5 1 4\u003cbr\u003e4 2 3 4 1\u003cbr\u003e\u003c/pre\u003e"}},{"title":"Sample Out 2","value":{"format":"HTML","content":"1"}},{"title":"Sample In 3","value":{"format":"HTML","content":"\u003cpre\u003e5 3 3\u003cbr\u003e1 2 3 1 1\u003cbr\u003e\u003c/pre\u003e"}},{"title":"Sample Out 3","value":{"format":"HTML","content":"5"}}]}