#P295. 【例50.1】陶陶摘苹果
【例50.1】陶陶摘苹果
Description
There is an apple tree in Taotao's yard that bears apples every autumn. When the apples are ripe, Taotao goes to pick them. Taotao has a centimeter high stool. When she cannot reach the apples directly with her hands, she stands on the stool to try again.
Given the heights of apples from the ground and the maximum height Taotao can reach when she stretches her arms, please help calculate how many apples she can pick. Assume that if she touches an apple, it will fall down.
Input Format
Two lines of data. The first line contains integers between and (inclusive), representing the heights of apples from the ground in centimeters, separated by spaces. The second line contains a single integer between and (inclusive), representing the maximum height Taotao can reach when she stretches her arms.
Output Format
A single line containing one integer, representing the number of apples Taotao can pick.
Sample
100 200 150 140 129 134 167 198 200 111
1105
Related
In following homework: