HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Array and Matrices > problem:


51083 - Grades Histogram

Guest
• Review clarifications (2)

Volume problems

• 50983 - Course Selection
• 50745 - Bitonic Sequence
• 50789 - Number of Cities
• 50987 - Very Looong Queue
• 50913 - Manhattan Distance
• 50981 - Top popular m-students
• 50729 - Max number in 2D array
• 50743 - Total Scholarships Discount
• 51083 - Grades Histogram
• 51024 - Total Stock Price
• 51008 - Sum of Regional Maxes
• 51014 - Nine Men's Morris game
• Word Puzzle
• 50740 - Service Time - 1
• 50928 - War Of Battleships
• 50930 - Tom and Jerry
• 50925 - Optimizing Elevator Usage

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