UVa 10074 - Take the Land

Summary
A Dynamic Programming problem. (Same with 108 and 10667)

Explanation
Create matrix A[m][n],where A[i][k]- longest line containing no 1 starting from (i,k). For all (i,k) do l-width j-height

Implementations

 * Code All the Problems
 * Created by Zaspire:

Input
6 7 0 1 1 0 1 1 0 0 0 0 0 0 1 0 1 1 0 0 0 0 1 0 1 0 1 0 0 1 1 1 0 0 0 1 0 1 1 0 1 1 0 0 6 7 0 1 1 0 1 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 1 0 1 0 0 1 1 1 0 0 0 1 0 1 1 0 1 1 0 0 0 0

Output
6 8