Find the longest increasing subsequence (MFC programming)