report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
Electricity bill - MarisaOJ: Marisa Online Judge

Electricity bill

Time limit: 1000 ms
Memory limit: 256 MB
Monthly electricity cost is calculated using the following rates: - From kWh $0$ to $50$: $a$ units. - From kWh $51$ to $100$: $b$ units. - From kWh $101$ to $150$: $c$ units. - From kWh $151$ and above: $d$ units. Given the number of kWh used as $x$ and four integers $a, b, c, d$, calculate the electricity cost. ### Input - A single line containing five integers $x, a, b, c, d$. ### Output - Print a single integer representing the total electricity cost. ### Constraints - $1 \le x, a, b, c, d \le 1000$. ### Example Input: ``` 60 1 2 3 4 ``` Output: ``` 70 ```
Input / Output and Condition
Hello Marisa!
A + B
A / B
Complex multiplication
Mushroom Classification
Integer equation
Age
Combine rectangles
String
Triangle
Rounded division
Circle
Calculator
The smallest and biggest
Rectangle
Segment
Distance
Ascending
Square number
Square numbers counting
Uppercase and lowercase
Letter Counting
Time format
Electricity bill
Eating mushroom
Topic
Basic
Rating 800
Solution (1) Solution