HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Beginner > problem:


50194 - OSHEE Electric Bill

Volume problems

• 50119 - Bank Charges
• 50126 - The Highest Average
• 50127 - Welcome Andi - 2
• 50132 - Class Average
• 50145 - Close City
• 50164 - The roots of a quadratic eq...
• 50192 - Nr of Missing Guests
• 50193 - Passing the course
• 50194 - OSHEE Electric Bill
• 50217 - Exchange the Values
• 50218 - Say Hello
• 50219 - Win or Lose
• 50220 - Area and Perimeter Of The ...
• 50221 - Calculate the Average
• 50222 - Even or Odd
• 50223 - Average of Test Scores
• 50225 - Convert to Minutes and Sec...

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.

OSHEE Electric Bill

OSHEE calculates the electric bills for home use as follows:

  • The first 300kWh is 7lek per kWh
  • Above 300kWh: 13lek per each additional kWh

Question: Write full program (C or C++) that gets the previous amount and current amount in kW. Then, calculate amount due from the user.

Input specification
You will be given two integers: previous (pa) and current (ca) amounts in kWh where 0 ≤ pa ≤ ca ≤ 25,000.

Output specification
Show just one number: the amount due from the user.

Sample Input 1
1000 1400
Sample Input 2
2400 2600
Sample Output 1
3400
Sample Output 2
1400

Explanation: The final hour is 1400 so he has used (1400-1000) 400kWh in this month. The first 300kWh is from 7 leke (2100) and extra 100kWh is from 13 leke (1300) and the total is 3400 leke.

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

www.contester.ru