Love picking apples time limit:MS | Memory limit:65535 KB Difficulty:1
-
Describe
-
There is an apple tree in the yard of Xiao Ming's house, and 10 apples will be produced in every fall tree. When Apple matures, Xiaoming will run to pick apples. Xiao Ming has a 30 cm high bench, when she can not directly pick the apples by hand, will step on the bench and try again.
Now that you know the height of 10 apples to the ground, and the maximum height that xiaoming can reach when you straighten your hand, please help Xiao Ming calculate the number of apples she can pick. If she touches an apple, the Apple will fall.
-
-
Input
-
-
the first line of input N (0<n<100) represents the number of test data groups, followed by two rows of data for each set of test inputs. The first line contains 10 integers from 100 to 200 (including 100 and 200), each representing 10 apples to the ground height, and two adjacent integers separated by a space. The second line contains only an integer (in centimeters) between 100 and 120 (containing 100 and 120), indicating the maximum height that xiaoming can reach when the hand is straightened.
-
-
Output
-
The
-
output includes one row, which contains only an integer that indicates the number of apples that xiaoming can pick up.
-
-
Sample input
-
-
1100 200 150 140 129 134 167 198 200 111110
-
-
Sample output
-
-
5
Package Acm03;import Java.util.scanner;public class Main1 {private static final int HEIGHT = 30;public static void Main (St Ring[] args) {Scanner input = new Scanner (system.in); int n = Input.nextint (); for (int i = 0;i<n;i++) {int [] array = NE W int[10];for (int j = 0;j<array.length;j++) {Array[j] = Input.nextint ();} int height = input.nextint (); int sum = height + height;int result = count (array,sum); SYSTEM.OUT.PRINTLN (result);}} private static int count (int[] array,int sum) {int count = 0;for (int i = 0;i<array.length;i++) {if (Array[i] <= sum ) {count++;} else {continue;}} return count;}}
Xiao Ming, who loves picking apples