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

Сборники > Data Structures > задача:


Post Office Delivery

Задачи сборника

• 50842 - Minimum Sum Triangle - DP
• 50781 - ReversesreveR
• 50676 - Cinema Millennium
• 50780 - Hot Potato - Revisited
• 50678 - The Jumping Rabbit
• 50793 - Top M Customers
• 51073 - Campus Tours for High Sch...
• Check-Mate
• Post Office Delivery
• 50993 - Products in store
• 50564 - Kovat e qumeshtit te mamase
• 50593 - Transportimi
• 50598 - Shuma minimale
• 50704 - Te lidhura?
• 50705 - Klubet e studenteve
• 50779 - Rruga me e shkurter ne lab...
• 180. 50776 - Numri i rrugeve te ndry...

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

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