Best students

In Germany, the grading system is very different. The best grade is 1 and the worst one is 6.
German Grade
Grade Description
US grade
1 – 1.5
Very Good
A
1.6 – 2.5
Good
B
2.6 – 3.5
Satisfying
C
3.6 – 4.9
Sufficient
D
5.0 – 6.0
Insufficient
F
Given many student grades, you are asked to calculate how many students are the most hard-working and have a grade in range [1; 1.5].
The program should stop execution as soon as the grade is outside the range [1; 6].
The output should contain the number of students who are in the given range.
Input
Output
4 3.2 1.2 1.1 4.2 6 1.6 1 7
3
 

Constraints

Time limit: 2 seconds

Memory limit: 512 MB

Output limit: 1 MB

To check your solution you need to sign in
Sign in to continue