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.
Для отправки решений необходимо выполнить вход.
|