#B3823. Ramen Shop Profit Calculation
Ramen Shop Profit Calculation
Ramen Shop Profit Calculation
Aya runs a ramen shop which is open for a hours and closed for b hours each day. During the operating hours, due to the steady stream of customers, the shop uses k jin of flour every hour to produce ramen. Each jin of flour yields ramen that earns r yuan in sales, while the cost of one jin of flour is c yuan.
Assuming there is no loss during noodle production and no additional expenses, calculate the net profit of operating the ramen shop for one day. Note that the net profit is defined as the total revenue minus the total cost.
The calculation is given by the formula:
$$\text{Profit} = a \times k \times (r - c)$$inputFormat
The input consists of five space-separated integers: a, b, k, r, c, where:
- a represents the number of operating hours.
- b represents the number of hours the shop is closed.
- k represents the amount of flour (in jin) used per operating hour.
- r represents the revenue obtained from one jin of flour.
- c represents the cost of one jin of flour.
outputFormat
Output a single integer representing the net profit for one day.
sample
10 5 3 20 10
300