题目描述
Problem Description
GigaCode Inc. conducts recruitment interviews every year.
This company places great importance on two aspects in recruitment: "Technical Skills" and "Social Skills". In the recruitment process, they score each applicant on a scale of 0 to 100 for both "Technical Skills" and "Social Skills", and only those who meet both of the following conditions are considered for acceptance:
- The applicant must score at least $X$ points in Technical Skills and at least $Y$ points in Social Skills.
- The total score of Technical Skills and Social Skills must be at least $Z$ points.
This year, $N$ university students applied. The $i$-th applicant scored $A_i$ points in Technical Skills and $B_i$ points in Social Skills. Determine how many applicants will pass the recruitment interview.
Input Format
The input is given from the standard input in the following format:
$ N $ $ X $ $ Y $ $ Z $ $ A_1 $ $ B_1 $ $ A_2 $ $ B_2 $ $ A_3 $ $ B_3 $ ... $ A_N $ $ B_N $
Output Format
Output an integer representing how many applicants will pass the recruitment interview.
Sample Input and Output
Sample Input #1
1 60 20 100
72 28
Sample Output #1
1
Sample Input #2
5 70 70 150
72 77
70 90
65 88
75 75
97 84
Sample Output #2
3
Sample Input #3
15 80 60 150
20 24
33 17
29 36
40 18
15 27
10 41
53 77
42 15
12 17
32 10
19 28
37 27
91 2
13 25
40 40
Sample Output #3
0
Notes/Hints
Constraints
- $1 \leq N \leq 100$
- $0 \leq A_i \leq 100$
- $0 \leq B_i \leq 100$
- $0 \leq X \leq 100$
- $0 \leq Y \leq 100$
- $0 \leq Z \leq 200$
- All inputs are integers
Partial Points
This problem is divided into several sub-tasks, and you will be considered to have solved a sub-task if you correctly solve all test cases in that sub-task.
The score of your submitted source code will be the sum of the points of the sub-tasks you solved.
- (30 points) $ N = 1 $
- (30 points) All $ N $ applicants pass the recruitment interview.
- (40 points) No additional constraints.
Hint for Sub-task 1
In Sub-task 1, all test cases have $ N = 1 $. That is, the input is given in the following format:
$ N $ $ X $ $ Y $ $ Z $ $ A_1 $ $ B_1 $
At that time, if all conditions $X \leq A_1, Y \leq B_1, Z \leq A_1 + B_1$ are satisfied, the first applicant passes, so output $ 1 $. Otherwise, output $ 0 $.
Note that this sub-task can be solved without using iterative processing.
Hint for Sub-task 2
In Sub-task 2, the answer is always $ N $.
Hint for Sub-task 3
Using iterative processing such as a for loop and conditional branching such as an if statement can help solve this sub-task.
Sample Explanation 1
The first applicant meets the following conditions and thus passes:
- The score in Technical Skills is $ 72 $ points, which is above the passing criterion of $ 60 $ points.
- The score in Social Skills is $ 28 $ points, which is above the passing criterion of $ 20 $ points.
- The total score of Technical Skills and Social Skills is $ 72 + 28 = 100 $ points, which is above the passing criterion of $ 100 $ points.
Therefore, the number of passing applicants is $ 1 $.
This input-output example satisfies the constraints of the first sub-task (Sub-task $ 1 $) and also the second sub-task (Sub-task $ 2 $).
Sample Explanation 2
Only the second, fourth, and fifth applicants pass.
This input-output example does not satisfy the constraints of Sub-task $ 1 $ since $N \neq 1$.
Sample Explanation 3
This recruitment test is very challenging.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分