#P1046. [NOIP 2005 普及组] 陶陶摘苹果
[NOIP 2005 普及组] 陶陶摘苹果
Description
There is an apple tree in Taotao’s yard. Every autumn the tree bears apples. When the apples ripen, Taotao goes to pick them. Taotao has a -centimeter-tall stool; when she cannot reach an apple directly with her hand, she will step on the stool and try again.
Now you are given the heights above the ground of the apples, and the maximum height Taotao can reach when she stretches out her hand. Please help Taotao calculate how many apples she can pick. Assume that if she touches an apple, it will fall.
Input Format
The input consists of two lines of data. The first line contains integers between and inclusive (in centimeters), representing the heights above the ground of the apples, separated by single spaces. The second line contains a single integer between and inclusive (in centimeters), representing the maximum height Taotao can reach when she stretches out her hand.
Output Format
Output a single line containing one integer, which is the number of apples Taotao can pick.
100 200 150 140 129 134 167 198 200 111
110
5
Hint
[Source]
NOIP 2005 Junior, Problem 1.
Translated by ChatGPT 5
京公网安备 11011102002149号