How to find minimal submatrix with at least K 1's in a 0-1 matrix
===

I have encountered an inoridinary problem that given a NxM 0-1 matrix and a number K(<=NxM) and I have to find a submatrix of that 0-1 matrix with at least K 1's in inside that submatrix. Furthermore it's area(the product of both dimensions) should be minimized.

For example:<br>
00000<br>
01010<br>
00100<br>
01010<br>
00000<br>
K = 3<br><br>
So I can find a submatrix with minimal area 6 that contains 3 1's inside.<br>
10<br>
01<br>
10

