You have an array of N cups. A cup is defined by its base area and height. You can only stack a cup on top of another if its base area and height are greater than or equal to the prior cup. Your goal is to find the maximum number of cups that can be stacked.
For example, given the cups [3,4], [6,4], [5,7], [1,3], the maximum stack would be 3, i.e [1,3], [3,4], [5,7] or [1,3], [3,4], [6,4] (remember you can't stack [5,7] on top of [6,4] or vice-versa, so you'll only pick one).