{"problem":{"name":"Dividing Chocolate","description":{"content":"We have a chocolate bar partitioned into $H$ horizontal rows and $W$ vertical columns of squares. The square $(i, j)$ at the $i$\\-th row from the top and the $j$\\-th column from the left is dark if $S","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc159_e"},"statements":[{"statement_type":"Markdown","content":"We have a chocolate bar partitioned into $H$ horizontal rows and $W$ vertical columns of squares.\nThe square $(i, j)$ at the $i$\\-th row from the top and the $j$\\-th column from the left is dark if $S_{i,j}$ is `0`, and white if $S_{i,j}$ is `1`.\nWe will cut the bar some number of times to divide it into some number of blocks. In each cut, we cut the whole bar by a line running along some boundaries of squares from end to end of the bar.\nHow many times do we need to cut the bar so that every block after the cuts has $K$ or less white squares?\n\n## Constraints\n\n*   $1 \\leq H \\leq 10$\n*   $1 \\leq W \\leq 1000$\n*   $1 \\leq K \\leq H \\times W$\n*   $S_{i,j}$ is `0` or `1`.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$H$ $W$ $K$\n$S_{1,1}S_{1,2}...S_{1,W}$\n$:$\n$S_{H,1}S_{H,2}...S_{H,W}$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc159_e","tags":[],"sample_group":[["3 5 4\n11100\n10001\n00111","2\n\nFor example, cutting between the $1$\\-st and $2$\\-nd rows and between the $3$\\-rd and $4$\\-th columns - as shown in the figure to the left - works.\nNote that we cannot cut the bar in the ways shown in the two figures to the right.\n![image](https://img.atcoder.jp/ghi/ac90dd542639c04402125403b1c319d7.png)"],["3 5 8\n11100\n10001\n00111","0\n\nNo cut is needed."],["4 10 4\n1110010010\n1000101110\n0011101001\n1101000111","3"]],"created_at":"2026-03-03 11:01:14"}}