dynamic programming: WIS problem