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

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


HW101. 50682 - Hotel Durres

CEN303_2016Questions

Старт: 28.окт.2016 в 17:00:00
Финиш: 01.ноя.2016 в 05:00:00
Турнир завершён!
• Турнирная таблица

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

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

• HW061. 50448 - Paint Buckets
• HW062. 51021 - Number of Nodes
• HW071. 51042 - The most frequent ...
• HW072. 51043 - Genome Sequencing
• HW081. 51044 - Number of Trees
• HW082. 50699 - Fighting Vampires
• HW083. 50671 - Phalanx
• HW091. 51061 - The Longest Path
• HW101. 50682 - Hotel Durres
• HW102. 51067 - Jumping frog
• HW111. 50506 - The Biggest Island
• HW112. 50698 - Ayran Delivery
• PE11. 51023 - Preparing Keyword I...
• PE12. 50835 - Club Presidency
• PE13. 51024 - Total Stock Price
• PE14. 50998 - CEN112 Homework, ...
• PE21. 51071 - Phalanx-2

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

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

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
14-Fall2-60.

Hotel Durres

Durres is a famous city with its historic and touristic places. Hotel Durres is located in a high mountain and far from the city. It's one of the biggest touristic hotels in the region which accepts many tourists every year.

Because the hotel is far from the city, it uses a gas tank for its heating system. Filling the gas tank costs a lot and the operation is very noisy and disturbing the clients. It's so noisy that it can be handled just once a day (on a certain time of the day). The director of operations, wants to reduce the costs in such a way that the tank will be filled when the amount in the tank cannot support the activities for that day.

Question: Assuming that the tank is full in the beginning, write a program that is going to find out the minimum cost of filling and the amount of gas used for the given period and for the given number of clients. Note: Assume that the amount in the tank supports the max number of people in one day.

Input specification: There are 4 numbers in the first line:

  • number of days: an integer where 0 < (number of days) < 30000
  • Tank capacity: a floating point number between 100 and 5000
  • c: the cost of filling, an integer
  • Gas used per person: a floating point number 0 < (Gas used per person) ≤ 10.
The following n lines list the number of clients for the following n days and each of the number is between 0 and 500.

Output specification
Show two integers: the amount of money spent for filling the tank. The amount of gas bought (with respect to the number of people, like gas for 10 people).

Sample Input I
6 50.0 50 1.0
23 24 15 14 14 47
Sample Output I
100 90

Explanation: In the beginning, the tank is full. Because for every person 1 liter gas is needed, the full tank supports 50 people. So, the current tank supports for the first two days, but it has to be filled before the third day (47 liters bought). Then, the second tank supports the third (15), the fourth (14) and the fifth (14) days (43 liters bought). The current amount suffices for the last day. So, the tank has been filled twice (2x50) $100, and gas for 90 people (90x 1 liters) of gas has been bought.


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

www.contester.ru