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

Турниры > CEN254 PRE1A > задача:


1. 51083 - Grades Histogram

CEN254 PRE1A

Старт: 11.янв.2018 в 01:08:15
Финиш: 11.янв.2018 в 01:08:15
Турнир завершён!
• Турнирная таблица

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

Задачи турнира

• 1. 51083 - Grades Histogram

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

Если у вас есть предложения или пожелания по работе 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