Ice and Fire

Please can someone tell me how to apply DP in Ice and Fire problem. Thanks in advance.

I advice you to go through the easier version of the problem of finding the best rectangle in codechef practise problems … try to understand it or do it yourself and then formulate solution for this problem based on that.