A classical problem in Computer Science is the 0-1 Knapsack problem. In this problem, you are given ~N~ items with the ~i~th item takes up a capacity of ~c_i~ and has a value of ~v_i~, and a knapsack with capacity ~C~, and try to maximize sum of the value of the items in the knapsack while not exceeding the capacity of the knapsack.
Unfortunately, your knapsack has just broke (again). Since you can't fix it, you decide to get a new knapsack. Upon doing so, you shall attempt to solve the knapsack problem with this new knapsack. What size of knapsack will maximize the value of the items you can get?
~1 \le N \le 10^5~
~-10^9 \le v_i \le 10^9~
~0 \le c_i \le 10^5~
The first line will have a single integer ~N~, the number of items.
The next ~N~ lines will each have two integers, ~c_i~ and ~v_i~.
A single non-negative integer, the minimum size of the knapsack that maximizes the sum of the values of the item you place in your knapsack.
Sample Input 1
2 1 0 9 2
Sample Output 1
Sample Input 2
1 1 -9000
Sample Output 2