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

Турниры > ProgramHER 2019 > задача:


4. Post Office Delivery

ProgramHER 2019

Старт: 03.мар.2019 в 09:59:00
Финиш: 03.мар.2019 в 12:54:00
Турнир завершён!
• Турнирная таблица

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

• 1. Word Puzzle
• 2. Trip to Librazhd
• 3. Check-Mate
• 4. Post Office Delivery

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

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

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

Post Office Package Delivery

The central post office has two service vehicles to deliver the mails. They need to deliver packages to the local neighborhood. But the vehicles have certain capacity and for safety reasons, they cannot take more that capacity. Since the packages cannot be taken partially, they need to choose some packages such that they can carry maximum total weight of packages using these vehicles. For example, if there are 5 packages with the weights: 5, 5, 7, 2 and 4; and if each vehicle can carry at most 10 kgs. It is better if the vehicles carry 5+5 and 7+2 and skip 4

Question: Write a program that is going to get the capacity of vehicles and weights of packages. And, print the maximum amount that can be distributed in one round.

Input specification
: First line contains three integers: The number of packages (n) and the total amount that each vehicle can carry (C1, C2). The following line contains n integers where 3 = n = 18; C1 and C2 are between 0 and 2,000; and weight of each packages is an integer between 0 and 200.

Output specification:
Show the maximum amount that can be distributed in one round.

Sample Input I
6 90 90
55 20 35 20 55 10
Sample Output I
175

Explanation for sample input 1:
for sample input 1: The two vehicles can carry totally 175 kgs (90 + 85). The first vehicle can take two packages (35 + 55). And the other can take the other three (55 + 20 + 10).



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

www.contester.ru