HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > CEN254 PRE1A > problem:


1. 51083 - Grades Histogram

CEN254 PRE1A

Start: Jan.11.2018 at 01:08:15 AM
Finish: Jan.11.2018 at 01:08:15 AM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (2)

Contest problems

• 1. 51083 - Grades Histogram

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Question by Ibrahim Mesecan.

Grades Histogram

The university administration wants to see student grades histogram using the selected intervals. Student grades are from many courses and are integers between 1 and 100. If administration chooses grade-interval 10: student grades will be counted for every 10: 1..10, 11..20, ... 91..100. Similarly, if grades interval is 18: 1..18, 19..36, .. 73..90, 91..100.

Question: Write a program that receives student grades and an interval, the program prints the grades histogram.

Input specification: In the beginning you will be an integer (n): number of students. Then, you will be given n integers in the following lines. The last line contains one integer: the interval requested; where 0 ≤ n ≤ 25,000 and the interval is between 1 and 50.

Output specification: Show the number of students for each interval.

Sample Input I Sample Input II
6
10 44 85 98 66 75
20
10
51 37 85 72 15 43 5 99 81 45
18
Sample Output I Sample Output II
1
0
1
2
2
2
0
4
1
2
1

Explanation: for Sample input 1: The interval is 20. There is only one grade less than 20 (10). There is no grade between 21 and 40. There are 2 grades between 61 and 80, etc. For Sample input 2: The first interval is between 1 and 18; and there are two grades within the first interval. The second interval is (19 ... 36); no grades within the second interval. There are 4 grades (51, 37, 43 and 45) within the third interval (37...54), etc.



Для отправки решений необходимо выполнить вход.

www.contester.ru