Certain O(NNM) solution have got accepted using fast input output :(.
What is meant by “Suppose the matrix is…left and right are both exclusive” in the editorial and why left and right are similar. Plz clear me this that why are we using left, up, right.
I used the exact approach as above but getting NZEC error (java) pls help.
http://www.codechef.com/viewsolution/3253203
Similarly, we define d[l][r] as answer for corresponding query. The answer is max{c[i][j] * (j - i + 1), d[i][j - 1], d[i + 1][j]} (the bounary case is d[i][i-1] = 0). So, we should fill in the d[][] in order of increasing the length of interval j - i + 1, in similar way to that we get c[][].
Can somebody elaborate on this part … really unclear… what is i,j and how are we obtaining d[][] by using c[][] …
freopen("ip.txt","r",stdin); in C submission?
OK, thanks for your suggestions, I have uploaded a figure to try to help you undertand this editorial (also some sentence are added to explain the “extend”). I hope you can learn the DP from this editorial 
Thanks for your suggestions. I have added a figure.
That’s a good question to the Problem Setter.
oh really? can you share some details? It will be helpful to setter and tester to find stronger test cases I think.

it has been commented.and how it is going to affect the run time of the program…
http://www.codechef.com/viewsolution/3170885
I only used very fast I/O, nothing special besides that. Also, my solution’s runtime (other than I/O) depends only on the numbers N,M and not on some other properties of the given matrix or queries.
What? I fast scaned your solution, it looks like a O(NM) algorithm? You mean the “stack” for another M? It seems that all number will be in/out the stack only once. Therefore O(NM) in total?
No, there are three nested for-loops clearly visible in inline void racunajsol()
Thanks mate
…much appreciated
add link please 
you used cout in C++ and printf in C which is much faster than cout …
can anyone tell the complexity of my C sol link given above. Is it according to the editorial or not?
my pleasure to help you 
wait, I see a totally different solution than what I read before… let me have a look