codeeval126 impl 2D-DP