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

Турниры > IMPC - 2013-2014 > задача:


14-07-10. 50383 - Noisy Mornings

IMPC - 2013-2014

Старт: 16.мар.2013 в 12:00:00
Финиш: 16.мар.2013 в 17:00:00
Турнир завершён!
• Турнирная таблица

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

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

• 14-05-40. 50689 - The biggest build...
• 14-05-50. 50414 - Traffic
• 14-05-50. 50421 - Repairing road s...
• 14-05-60. 50371 - Modified Karnaug...
• 14-05-70. 50477 - Character Pyramids
• 14-05-80. 50372 - Number Quadrup...
• 14-05-90. 50549 - k-Nearest Neigh...
• 14-05-95. 50479 - Bit Compressor
• 14-07-10. 50383 - Noisy Mornings
• 14-07-20. 50384 - Permutations revi...
• 14-07-30. 50385 - The 3n + 1 problem
• 14-07-50. 50367 - Bar Codes
• 2013-03-10. 50579 - Numrat pentag...
• 2013-03-20. 50589 - Numri i vezeve...
• 2013-03-30. 50559 - Faktoret e thje...
• 2013-03-40. 50685 - Perdorimi i dh...
• 2013-04-10. 50335 - Five Math Ope...

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

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

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Question by Osman Ay.

Noisy Mornings

 

A group of computer science teacher having a professional development program in Ankara. They are accommodated in a luxury dormitory. The weather is perfect, the food is delicious, participants are enthusiastic, and instructors are polite and expert in their fields. Everything is fine except the noisy mornings. The program starts at nine o’clock in the morning. Thus, every teacher sets his alarm clock for a certain time between 08:00 and 08:55. It is possible to set the alarm and snooze time-out periods in the alarm clocks (or mobile phones). Some teachers wake up as soon as the alarm starts, however; some teachers listen to the alarm melody as a lullaby and continue sleeping. Make a program to find the loudest noise volume in the morning at the dormitory. Every teacher stops the alarm clock immediately after he wakes up.

Input

The first line of the input contains a single integer N (1 <= N <= 100) that is the number of the teachers. Each of the following N lines describes a  teacher with several space-separated entries: Alarm start time,  alarm time period, snooze time-out period, noice volume, and the time the teacher wakes up.

Output

Print the maximum noice volume in the mornign at the dormitory between 08:00 o’clock and 09:00 o’clock (both included). The total noise volume of some alarms is the sum of their volumes.

Sample Input1

3

08:00 5 6 10 08:20

08:04 3 1 3 08:10

08:07 2 10 8 08:10

Sample Output1

13

 

Sample Input2

4

08:00 5 6 10 08:13

08:10 10 10 20 08:15

08:05 5 3 5 08:45

08:14 2 4 8 08:33

Sample Output2

35

 

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

www.contester.ru