Company: Probo_4july
Difficulty: medium
Taichi and Land Problem Description Taichi is going to buy land, so he went to an agency. In turn, the agency took him to a place where there is a rectangular free plot of dimension N x M. There is treasure buried under this land, and Taichi has a machine to find those treasures. Some of these treasures have a positive value, and some have a negative value. Taichi is very greedy, so he wants to buy multiple rectangular pieces of land to maximize his profit. However, there is a small problem: if the total value of treasure he gets from a single rectangular plot exceeds K, then the local authorities would arrest him. Therefore, he needs your help to find the maximum total value of treasure he can get by buying multiple rectangular plots of land such that no single plot exceeds K in value. Input Format - Input in first-line N and M. For the next N lines M elements representing the 2D array. Finally an integer K Output Format - Returns an integer Examples Example 1: Input: 2 3 0 -2 3 1 0 1