410370: GYM104013 B Bicycle

Memory Limit:512 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

B. Bicycletime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard output

After a long time at home during the quarantine, in November you decided to go to work by bicycle! Since you do not have your own bicycle, you have to rent one. The bike rental allows you to choose one of two monthly options:

  • The monthly fee is $$$a$$$ roubles. Every day, the first $$$30$$$ minutes are free, and every minute above that costs $$$x$$$ roubles.
  • The monthly fee is $$$b$$$ roubles. Every day, the first $$$45$$$ minutes are free, and every minute above that costs $$$y$$$ roubles.

There are $$$21$$$ working days in November, and you spend $$$T$$$ minutes commuting to work and back home in total every day. Calculate how many roubles you would spend if you use either one of two monthly options.

Input

The first four lines of the input contain integers $$$a$$$, $$$x$$$, $$$b$$$, and $$$y$$$ ($$$0 \leq a, x, b, y \leq 100$$$), each on a separate line. The last line contains a single integer $$$T$$$ ($$$1 \leq T \leq 1440$$$) — the total time spent on a bicycle during each day.

Output

The only line of the output should contain two integers — the amount of money you would spend on the first option and the second option, respectively.

ExamplesInput
10
1
20
5
50
Output
430 545
Input
10
10
10
10
42
Output
2530 10
Input
10
10
10
10
27
Output
10 10

加入题单

上一题 下一题 算法标签: