Total cost
Practice
3.6 (67 votes)
Basic programming
Basics of implementation
Easy
Implementation
Problem
80% Success 16042 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code
A family consists of \(x\) members. You are given the task to book flight tickets for these \(x\) members.
You are given the following information about the airline in which you have to book the tickets:
- \(P\): It denotes the cost of one ticket of the flight.
- \(S\): It denotes the number of total available seats in the flight.
- \(T\): If the numbers of available seats are less than or equal to \(T\), then the cost of the flight ticket increases to \(H\).
- \(H\): It denotes the new hiked cost.
Determine the total cost to book the tickets for all the family members.
Note: The tickets are booked one by one for all the family members.
Input format
First line: Five space-separated integers \(P,S,T,H,\) and \(x\) respectively
Output format
Print the total cost to book the tickets for all the members of the family.
Constraints
\(1 \le P \le H \le 10^5\)
\(1 \le S \le 300\)
\(1 \le T \le S\)
\(1 \le x \le S\)
Submissions
Please login to view your submissions
Similar Problems
Points:20
426 votes
Tags:
Ad-HocApprovedBasic ProgrammingEasyOpen
Points:20
836 votes
Tags:
Ad-HocSimulationEasyMathematicsOpenApprovedMathamatics
Points:20
319 votes
Tags:
Ad-HocEasyOpen
Editorial