Bicycle
InterviewTime limit2sMemory limit512 MB
For each of two bike rental plans, compute the monthly cost over 21 working days given a daily riding time T and per-minute overage rates.
- Level
Easy2 of 10
- Topics
- Math, Implementation, Simulation
- Solved
- No attempts yet
Problem
After spending a long time at home during the quarantine, in November you decided to commute to work by bicycle. You do not own a bicycle, so you have to rent one. The rental service offers two monthly plans:
- The monthly fee is roubles. Each day the first minutes are free, and every minute beyond that costs roubles.
- The monthly fee is roubles. Each day the first minutes are free, and every minute beyond that costs roubles.
November has working days, and you spend minutes in total on the bicycle each day commuting to work and back home. Calculate how many roubles you would spend under each of the two monthly plans.
Input
The first four lines contain the integers , , , and (), one per line. The last line contains a single integer (), the total time spent on the bicycle each day.
Output
Print a single line with two integers: the amount of money you would spend on the first plan and on the second plan, in that order.