Submit solution
Points:
5
Time limit:
1.0s
Java
2.0s
Python
1.5s
Memory limit:
256M
Author:
Problem type
You have
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?
Constraints
Input Specification
The first line of input contains an integer
The next
Output Specification
Output the height of the tallest possible tower.
The height of any given tower is the sum of the heights of its boxes.
Sample Input
Copy
3
5 2
5 3
2 10
Sample Output
Copy
13
Explanation for Sample
You can use the
Comments