• + 1 comment

    I think the Diff should like this

      0   0   0   0   0 
      100  0  -100  0    0  <--- 1 2 100, 3rd col is 100 less than 2nd col 
      100  100 -100 0    0  <--- 2 5 100, 2nd col is 100 more than 1st col
      100  100  0  0  -100   <--- 3 4 100, now 3rd is equal to 2nd, and 5th is 100 less than 4th col
    

    so finally, 1st col is always the real value, and others are accumlated of previous values and it self. so actual values are 100 200 200 200 100, max is 200