Now, problem 155 is implemented via DP. But it executes very slow: execution time is 45-50 seconds approximately (though it is corresponding the one minute rule). According to thread of problem 155, there are solutions with execution time less than 1 second. So i must improve implementation of this problem.