Elections in Punjab

5

1 votes
Problem

Punjab state will hold elections. The candidates are Navjot and Charanjit.

The state consists of N cities, theith of which hasA(i)pro-Navjot voters and B(i) pro-Charanjit voters. There are no other voters. Charanjit can make a speech in each city.

If he makes a speech in some city, all voters in that city, pro-Charanjit or pro-Navjot, will vote for Charanjit.

On the other hand, if he does not make a speech in some city, the pro-Navjot voters in that city will vote for Navjot, and the pro-Charanjit voters will not vote.

To get more votes than Navjot, in how many cities does Charanjit need to make speeches at least?

Constraints

All values in inputs are Integers .

1<=N<=2105

1<=Ai,Bi<=109
Input
First line - number of towns N

Second line - 
N lines will contain values for A(i) and B(i) for i−th town

Output
Print the answer.

Example :
Input
4
2 1
2 2
5 1
1 3

Output
1

Explanation

For example in above input after making a speech in the third city, Navjot and Charanjit will get 5 and 6 votes, respectively.

Sample Input
5
2 1
2 1
2 1
2 1
2 1
Sample Output
3
Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

In above example after making speeches in three cities, Navjot and Charanjit will get 4 and 9 votes, respectively.

Editor Image

?