시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 256 MB61764622432375.962%

문제

JOI군이 살고 있는 지역에는 X사와 Y사, 두 개의 수도회사가 있다. 두 회사의 수도요금은 한 달간 수도의 사용량에 따라 다음과 같이 정해진다.

  • X사 : 1리터당 A엔.
  • Y사 : 기본요금은 B엔이고, 사용량이 C리터 이하라면 요금은 기본요금만 청구된다. 사용량이 C리터가 넘었을 경우 기본요금 B엔에 더해서 추가요금이 붙는다. 추가요금은 사용량이 C리터를 넘었을 경우 1리터를 넘었을 때마다 D엔이다.

JOI군의 집에서 한 달간 쓰는 수도의 양은 P리터이다.

수도요금이 최대한 싸게 되도록 수도회사를 고를 때, JOI군의 집의 1달간 수도요금을 구하여라.

입력

입력은 5줄이고 한 줄에 하나씩 정수가 입력된다.

  • 첫 번째 줄에는 X사의 1리터당 요금 A가 입력된다.
  • 두 번째 줄에는 Y사의 기본요금 B가 입력된다.
  • 세 번째 줄에는 Y사의 요금이 기본요금이 되는 사용량의 상한 C가 입력된다.
  • 네 번째 줄에는 Y사의 1리터 당 추가요금 D가 입력된다.
  • 다섯 번째 줄에는 JOI군의 집에서 사용하는 한 달간 수도의 양 P가 입력된다.

입력되는 정수 A,B,C,D,P는 전부 1 이상 10000 이하이다.

출력

JOI군의 집에서 지불하는 한 달간 수도요금을 첫째 줄에 출력한다.

예제 입력 1

9
100
20
3
10

예제 출력 1

90

예제 입력 2

8
300
100
10
250

예제 출력 2

1800

힌트

입출력예제 1에서, JOI군의 집에서 사용하는 수도의 양은 10리터이다.

  • X사의 수도요금은 9 × 10 = 90엔이다.
  • JOI군의 집에서 사용한 양이 20리터 이하이므로 Y사의 수도요금은 기본요금인 100엔이다.

JOI군의 집은 수도요금이 더 싼 X사를 고르고, 이때의 한 달치 수도요금은 90엔이다.

입출력예제 2에서, JOI군의 집에서 사용하는 수도의 양은 250리터이다.

  • X사의 수도요금은 8 × 250 = 2000엔이다.
  • JOI군의 집에서 사용한 양이 100리터 이상이므로 초과량은 250 - 100 = 150리터이다. 따라서 Y사의 수도요금은 기본요금인 300엔에 더해서 10 × 150 = 1500엔의 추가요금이 붙고, 총 요금은 300 + 1500 = 1800엔이 된다.

JOI군의 집은 수도요금이 더 싼 Y사를 고르고, 이때의 한 달치 수도요금은 1800엔이다.

W3sicHJvYmxlbV9pZCI6IjEwNzA3IiwicHJvYmxlbV9sYW5nIjoiMCIsInRpdGxlIjoiXHVjMjE4XHViM2M0XHVjNjk0XHVhZTA4IiwiZGVzY3JpcHRpb24iOiI8cD5KT0lcdWFkNzBcdWM3NzQgXHVjMGI0XHVhY2UwIFx1Yzc4OFx1YjI5NCBcdWM5YzBcdWM1ZWRcdWM1ZDBcdWIyOTQgWFx1YzBhY1x1YzY0MCBZXHVjMGFjLCBcdWI0NTAgXHVhYzFjXHVjNzU4IFx1YzIxOFx1YjNjNFx1ZDY4Y1x1YzBhY1x1YWMwMCBcdWM3ODhcdWIyZTQuIFx1YjQ1MCBcdWQ2OGNcdWMwYWNcdWM3NTggXHVjMjE4XHViM2M0XHVjNjk0XHVhZTA4XHVjNzQwIFx1ZDU1YyBcdWIyZWNcdWFjMDQgXHVjMjE4XHViM2M0XHVjNzU4IFx1YzBhY1x1YzZhOVx1YjdjOVx1YzVkMCBcdWI1MzBcdWI3N2MgXHViMmU0XHVjNzRjXHVhY2ZjIFx1YWMxOVx1Yzc3NCBcdWM4MTVcdWQ1NzRcdWM5YzRcdWIyZTQuPFwvcD5cclxuXHJcbjx1bD5cclxuXHQ8bGk+WFx1YzBhYyA6IDFcdWI5YWNcdWQxMzBcdWIyZjkgQVx1YzVkNC48XC9saT5cclxuXHQ8bGk+WVx1YzBhYyA6IFx1YWUzMFx1YmNmOFx1YzY5NFx1YWUwOFx1Yzc0MCBCXHVjNWQ0XHVjNzc0XHVhY2UwLCBcdWMwYWNcdWM2YTlcdWI3YzlcdWM3NzQgQ1x1YjlhY1x1ZDEzMCBcdWM3NzRcdWQ1NThcdWI3N2NcdWJhNzQgXHVjNjk0X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