Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

ML Vs AI

By msi1427 · Limits 1s, 512 MB

Nowadays, CS students try to learn Machine Learning and Artificial Intelligence even before learning the basics of programming which is obviously problem-solving. Eventually, they lose their curiosity about AI as well as CS.

Professor Bakhtiar got very anxious about it and discussed it with his colleague Professor Badhon. They came up with a solution and thought of experimenting if it works or not. But they don’t have enough time to build a system from scratch as they got a conference to attend next week. So now you have to implement the system.

The idea is as to take students who are good at problem solving. You will be given a list of n students with the total number of accepted solutions m and total number of submissions s for each student. If anyone has:

  • solved at least 150 problems,
  • solved more than or equal to the average number of accepted solutions among students, and
  • has no less than 70% acceptance rate

they will be allowed to study AI, otherwise not. You have to count the number of students eligible to study AI.

Input

Input starts with an integer n(0 < n <= 106), denoting number of students.

Next n lines contains two integer each m, s (0 < m, s <= 109) , described above.

Output

In one line, Print the answer.

Sample

InputOutput
5
10 10
150 214
200 300
1000 1300
100 300
1


Discussion
Statistics

67% Solution Ratio

BigO_cutterEarliest, 1M ago

RamprosadGFastest, 0.1s

mdvirusLightest, 2.1 MB

SoudipShortest, 195B

Submit

Login to submit