{"trustable":false,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n #problem-body \u003e pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tYou are given the sequence of all K-digit binary numbers: 0, 1,..., \u003cspan data-scayt_word\u003d\"2K-1\" data-scaytid\u003d\"1\"\u003e2\u003csup\u003eK\u003c/sup\u003e-1\u003c/span\u003e. You need to fully partition the sequence into M chunks. Each chunk must be a consecutive subsequence of the original sequence. Let S\u003csub\u003ei\u003c/sub\u003e (1 \u0026le; i \u0026le; M) be the total number of 1\u0026#39;s in all numbers in the ith chunk when written in binary, and let S be the maximum of all S\u003csub\u003ei\u003c/sub\u003e, i.e. the maximum number of 1\u0026#39;s in any chunk. Your goal is to minimize S.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tIn the first line of input, two numbers, K and M (1 \u0026le; K \u0026le; 100, 1 \u0026le; M \u0026le; 100, M \u0026le; 2^K), are given, separated by a single space character.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tIn one line of the output, write the minimum S that can be obtained by some split. Write it without leading zeros. The result is not guaranteed to fit in a 64-bit integer.\u003c/p\u003e"}},{"title":"Example","value":{"format":"HTML","content":"\u003cpre\u003e\r\n\u003cb\u003eInput:\u003c/b\u003e\r\n3 4\r\n\r\n\u003cb\u003eOutput:\u003c/b\u003e\r\n4\r\n\u003c/pre\u003e"}}]}