Bicycle | 프로그래밍의 벗 PivotOJ
PivotOJ

Bicycle

시간 제한: 2000ms메모리 제한: 512MB출처: ICPC 2020-2021 Northwestern Russia Regional ContestBOJ 20233

문제

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 aa roubles. Every day, the first 3030 minutes are free, and every minute above that costs xx roubles.
  • The monthly fee is bb roubles. Every day, the first 4545 minutes are free, and every minute above that costs yy roubles.

There are 2121 working days in November, and you spend TT 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.

입력

The first four lines of the input contain integers aa, xx, bb, and yy (0a,x,b,y1000 \leq a, x, b, y \leq 100), each on a separate line. The last line contains a single integer TT (1T14401 \leq T \leq 1440) --- the total time spent on a bicycle during each day.

출력

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.

예제

예제 1

입력
10
1
20
5
50
출력
430 545

예제 2

입력
10
10
10
10
42
출력
2530 10

예제 3

입력
10
10
10
10
27
출력
10 10
코드를 제출하려면 로그인하세요.