Title Description
Second brother usually like to grow some of their own things, and to write programs and see the biggest hobby outside the movie. Recently, two elder brother species of an apple tree to harvest time, but due to the height of the two elder brother limit, some apples too high to pick up. So two brother borrowed a stool, step on top can pick more apples.
Second elder brother is a lazy action person, he wants to know how many apples he can pick before picking an apple, if it is too little (the apple tree is very lush, mainly because of height), he would rather sit under the tree under the Apple himself fell to hit the head.
Input format
Enter a total of two rows.
The 1th line has 3 integers, representing the height of the elder brother, the height of the stool and the number of apples N.
The 2nd line has n integers, each representing the height of each apple.
Output format
Output an integer m, which means that the number of apples the elder brother can pick up is M.
Description
For all data: positive integers below 1000, the number of apples1≤n≤
。
Sample Input
177 40 10180 151 152 193 168 255 278 303 211 217
Sample Output
7
#include <iostream>
using namespace Std;
int main () {
int h1,h2,n,p,m=0;
cin>>h1>>h2>>n;
for (int i=0;i<n;i++) {
cin>>p;
if (P<=H1+H2) {
m++;
}
}
cout<<m;
return 0;
1001. Two brothers picking apples