poj 1836. DP. longest increasing & decreasing subsequence