dynamic programming: max increasing sequence