HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Functions > problem:


50435 - City Electric Bills

Guest
• Review clarifications (3)

Volume problems

• 50926 - School Mail Merge
• 50917 - Descending Numbers
• 50982 - A thief in labyrinth
• 50980 - The smallest rectangle
• 50932 - Shifting rows and columns
• 50933 - Sum of the Biggest Neighbors
• 50834 - The train which leaves the f...
• 51003 - Double Prime
• 50435 - City Electric Bills
• 50527 - Sum of LCMs
• 50353 - Cube of the Largest number
• 50539 - Number of Chairs - 2
• 50469 - Letter Grades
• 51012 - Palindrome-k
• 50559 - Prime Factors of a Number
• 002. 50428 - Three Times
• 003. 50432 - Numbers and Squares

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.

City Electric Bills

OSHEE calculates the electric bills for home use as follows:

  • The first 310kWh is 7.7lek per kWh
  • Above 310kWh: 13.5lek per kWh
  • City Enlightenment: 8lek per kWh
  • Value added tax (%20)

Question: Write a program that calculates the sum of bills for n clients when the consumption (kWh) and city enlightenment amounts are given. Note: Round payments for each client to the nearest integer.

Input specification
In the beginning, you will be given two integers

  • n: the number of clients where 0 ≤ n ≤ 3000.
  • cea: city enlightenment amount (kWh) which is between 0 and 200
then in the following n lines you will be given n integers (consumption) where 0 ≤ consumption ≤ 2000.

Output specification
Show one integer number: total amount of bills.


Sample Input  
3 41
420
235
310
Sample Output  
10863

Explanation:
The bill for the first customer is calculated as follows:

  • The first 310kw is from 7.7 lek per kw and 2387 leke
  • Exceeding 110kw is from 13.5 lek per kw and 1485 leke
  • 41 kw city enlightenment from 8 leke 328 leke
and the total is 4200. Then, 20% tax is added over it which makes the total: 5040 leke
  • The bill for the first client is 5040
  • The bill for the second client is 2565
  • The bill for the third client is 3258
Thus, the sum is 10863.
Для отправки решений необходимо выполнить вход.

www.contester.ru