You have boxes with varying dimensions of (width by height).
You are trying to create the tallest tower possible by stacking any combination of these boxes. In order to keep your tower balanced, you can only stack a box on top of another if its width is strictly less than the one below it. Assuming you do not place any boxes next to each other, what is the height of the tallest possible tower you can create?
The first line of input contains an integer .
The next lines of input each contain space-separated integers, and .
Output the height of the tallest possible tower.
The height of any given tower is the sum of the heights of its boxes.
Explanation for Sample
You can use the box as the base of the tower and stack the box on top of it.