HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > IMPC16 Group Contests > problem:


22. 50874 - Apartment Building Administration - 2

IMPC16 Group Contests

Start: Jan.16.2016 at 10:00:00 AM
Finish: Jan.16.2016 at 02:00:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (12)

Contest problems

• 02. 50833 - Min of Odd Positions
• 03. 50834 - The train which leaves ...
• 11. 50859 - Low performance
• 12. 50860 - Number of Student Certi...
• 13. 50861 - The largest Student Group
• 14. 50862 - Sum of the Pairs
• 15. 50863 - Total Access Cost of a BST
• 21. 50873 - Max Frequency
• 22. 50874 - Apartment Building ...
• 23. 50875 - Take m-out
• 24. 50876 - He is my cousin
• 25. 50877 - Friendly Queue
• 32. 50926 - School Mail Merge
• 33. 50927 - Health Expenses
• 34. 50928 - War Of Battleships
• 35. 50929 - Present from your uncles
• F1. 50841 - My grand-grand-grandfa...

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.

Apartment Building Administration -2

Question: Administrator of a block of apartments (and offices) has come to you for a program. The water consumption of the apartments/offices is calculated according to the people living 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 20. (If there are more than 20 people in an office or apartment, it is count as 20 people). 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 three numbers:

  • the number of apartments (n) and
  • the number of apartments (m)to calculate the result
  • the total amount to pay for all apartments.
where n and m are integers 0 ≤ m ≤ n ≤ 10,000. And the total amount to pay is a floating point number between 0 and 1,000,000. Then, in the following n lines you will be given the number of people living in n-apartments.

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

Sample Input I
6 3 7683
3
4
0
2
1
4
Sample Output I
5635

Explanation: There are 14 people in all the apartments. However, there is nobody in Apartment-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. Total number of people in m apartments in the sorted list is 11 (4 + 4 + 3). Then, the total amount to pay for top m apartments is 5635 (2049 + 2049 + 1537) leke.



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

www.contester.ru