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

Турниры > CEN112 Questions 2016 > задача:


15-PE-1. 50865 - Apartment Building Administration

CEN112 Questions 2016

Старт: 30.мар.2016 в 15:10:22
Финиш: 01.апр.2016 в 05:00:00
Турнир завершён!
• Турнирная таблица

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

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

• 15-HW-4. 50934 - Selling Cars
• 15-HW-5. 50935 - Max Discount
• 15-MdtE-1. 50915 - Trip to Korca
• 15-MdtE-2. 50916 - Ascending Num...
• 15-MdtE-3. 50913 - Manhattan Distance
• 15-MdtE-4. 50917 - Descending Nu...
• 15-MdtE-5. 50912 - Trip to Librazhd
• 15-MdtE-6. 50914 - Buy 3, Pay 2
• 15-PE-1. 50865 - Apartment Bui...
• 15-PE-2. 50866 - Buy the cheapest
• 15-PE-4. 50868 - Sort Frequencies
• 15-PE-5. 50869 - Birthday Celebration
• 15-PE-7. 50871 - Harmonic Mean
• 15-PE-8. 50872 - Top M Grades
• 15-PE2-1. 50980 - The smallest rect...
• 15-PE2-2. 50981 - Top popular m-st...
• 15-PE2-2. 50984 - Top m hardworki...

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

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

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

Apartment Building Administration

Question: Administrator of a block of apartments has come to you for a program. The water consumption of the apartments is calculated according to the people staying in the apartments. There is minimum and maximum limit for the number of people living. Even if there is no body living in an apartment, it is count at least one person living there. The highest number of people used in calculations is 10. (If there are more than 10 people, it is count as 10). Then, the usage per person is the total amount for all apartments divided by the number of people in all apartments. The amount to pay for one apartment is the number of people times amount per person.

Write a program that reads the information for the building and calculates the total amount due for m-apartments given.

Input specification:
You will be first given a number: the number of apartments (n). Then in the following n lines you will be given the number of people living in n-apartments. Then, you will be given total amount to be paid for all apartments (a floating point number). On the next line the number of apartments (m) to calculate the total amount is given. In the following m lines, you will be given the numbers of m apartments where 0 ≤ m ≤ n ≤ 2000.

Output specification:
Show the total amount to be paid by m apartments. Note: When calculating the amount for each apartment, round total for each apatment to the nearest integer.

Sample Input I
6
3
4
0
2
1
4
7683
3
2
4
5
Sample Output I
3585

Explanation: There are 14 people in all the apartments. However, there is nobody in Apartment number 3. And, it is count as 1 person. So, the result is calculated out of 15 people. The amount per person is 512.2 (total amount to pay (7683) divided by 15) leke. The amount due from 3 apartments is asked, apartments 2, 4, and 5. There are

  • 4 people living in Apartment:2, amount to pay is 2049
  • 2 people living in Apartment:4, amount to pay is 1024
  • 1 people living in Apartment:5, amount to pay is 512
Then, the total amount to pay by the m-apartments is (2049 + 1024 + 512) = 3585



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

www.contester.ru