HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > CEN303 2013-15 Questions > problem:


13-Fall2-50. 50686 - The Container

CEN303 2013-15 Questions

Start: Dec.15.2013 at 02:00:00 PM
Finish: Dec.15.2013 at 07:00:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (1)

Contest problems

• 50842 - Minimum Sum Triangle - DP
• 50319 - Toll Plazas
• 51000 - Book Index
• 50531 - File Decryption
• 50464 - From Tirana to Durres
• 13-Fall2-10. 50411 - Sum of the Lea...
• 13-Fall2-20. 50687 - Pascal Triangle - 2
• 13-Fall2-40. 50753 - Average of the...
• 13-Fall2-50. 50686 - The Conta...
• 14-Fall1-10. 50740 - Service Time - 1
• 14-Fall1-20. 50750 - Service Time - 2
• 14-Fall1-30. 50771 - BST Level Sum
• 14-Fall1-40. 50683 - Parking Buses
• 14-Fall1-50. 50770 - Average Depth
• 14-Fall1-60. 50784 - Top Growing C...
• 14-Fall2-10. 50751 - The biggest Mi...
• 14-Fall2-20. 50794 - Writing Files Int...

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Question by Ibrahim Mesecan.

The Container

A Cargo shipping company, uses large container ships and bulk carriers to carry cargos from different people. The cargos cannot be separated into pieces and the ship can carry at most certain amount of tones.

Question:
Given a set of items determine the max weight that can be carried such that it is less than or equal to a given capacity.

Input specification
Firstly, you are given two integer numbers (n and C) where n denotes the number of items and C denotes the total amount of tones (capacity) that the ship can carry. The next line will have n integer numbers where 1 ≤ n ≤ 100 and 1 ≤ C ≤ 1000. Each cargo item can be between 1 and 20 tones.

Output specification
Show just one integer number: max weight that can be carried with the ship.

Sample Input I   
5 15
3 4 5 6 8
Sample Input II   
8 15
2 2 2 2 2 2 2 2
Sample Output I   
15
Sample Output II   
14


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

www.contester.ru