SUBLCS
You are given a sequence $A_1, A_2, \ldots, A_N$. Consider every pair that consists of:
$1)$ One of the longest non-decreasing subsequences of $A$.
$2)$ One of the longest non-increasing subsequences of $A$.
Find the maximum possible length of the longest common subsequence of the two sequences in such a pair.