ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Разделы > Linear Data Structures: Arrays > задача:


51083 - Grades Histogram

Гость
• Вопросы к жюри (2)

Задачи раздела

• 50865 - Apartment Building Adminis...
• 50874 - Apartment Building Adminis...
• 51127 - Maze solver
• 51126 - Dr. Fllanxha
• 51021 - Number of Nodes
• 51044 - Number of Trees
• 51098 - Rotate a matrix
• 51061 - The Longest Path
• 51083 - Grades Histogram
• 51084 - Reflect a matrix
• 51011 - Decoding the Path
• 51088 - Number of letters
• 51172 - The biggest Minute
• 51125 - Filling an Array 3
• 51085 - xyx Divisible by k
• 51087 - Are they the same?
• 51091 - Guess the number - 1

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
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