Marks :100
: 1 | : 3
X and Y were in an election battle in their city. The city contains N towns and each town has M1 number of people who will vote for Y and M2 number of people who will not take part in the election. X after seeing the lack of his supporters decided to campaign.
If X does a campaign in town T both M1 and M2 people in that town become his supporters.
Your task is to calculate the least number of towns in which X has to campaign to win the election.
The first line contains N ($$$ 1 \le N \le 2*10^5 $$$).
The next N number of lines contains pairs {m1 and m2}($$$1 \le M1,M2 \le 10^9$$$).
For each test case print the least number of towns in which X has to campaign to win
4 2 1 2 2 5 1 1 3
1
2 2 2 2 2
1
It's always possible for X to win the election
You need to login to view your submissions.
You need to login to view all submissions.
Result : Executed
Feel something is wrong with the test cases?
Result : Accepted
Test Cases :
But to Run or Submit the Problem, you need to Log In.
Continue to Log InYour challenge has been submitted successfully.
You will get a response soon via WhatsApp or Email.
Do let us know your issue.