시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 1262 856 727 67.377%

문제

상근이는 트럭을 총 세 대 가지고 있다. 오늘은 트럭을 주차하는데 비용이 얼마나 필요한지 알아보려고 한다.

상근이가 이용하는 주차장은 주차하는 트럭의 수에 따라서 주차 요금을 할인해 준다.

트럭을 한 대 주차할 때는 1분에 한 대당 A원을 내야 한다. 두 대를 주차할 때는 1분에 한 대당 B원, 세 대를 주차할 때는 1분에 한 대당 C원을 내야 한다.

A, B, C가 주어지고, 상근이의 트럭이 주차장에 주차된 시간이 주어졌을 때, 주차 요금으로 얼마를 내야하는지 구하는 프로그램을 작성하시오.

입력

첫째 줄에 문제에서 설명한 주차 요금 A, B, C가 주어진다. (1 ≤ C ≤ B ≤ A ≤ 100)

다음 세 개 줄에는 두 정수가 주어진다. 이 정수는 상근이가 가지고 있는 트럭이 주차장에 도착한 시간과 주차장에서 떠난 시간이다. 도착한 시간은 항상 떠난 시간보다 앞선다. 입력으로 주어지는 시간은 1과 100사이 이다.

출력

첫째 줄에 상근이가 내야하는 주차 요금을 출력한다.

예제 입력 1

5 3 1
1 6
3 5
2 8

예제 출력 1

33
W3sicHJvYmxlbV9pZCI6IjI5NzkiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWQyYjhcdWI3ZWQgXHVjOGZjXHVjYzI4IiwiZGVzY3JpcHRpb24iOiI8cD5cdWMwYzFcdWFkZmNcdWM3NzRcdWIyOTQgXHVkMmI4XHViN2VkXHVjNzQ0IFx1Y2QxZCBcdWMxMzggXHViMzAwIFx1YWMwMFx1YzljMFx1YWNlMCBcdWM3ODhcdWIyZTQuIFx1YzYyNFx1YjI5OFx1Yzc0MCBcdWQyYjhcdWI3ZWRcdWM3NDQgXHVjOGZjXHVjYzI4XHVkNTU4XHViMjk0XHViMzcwIFx1YmU0NFx1YzZhOVx1Yzc3NCBcdWM1YmNcdWI5YzhcdWIwOTggXHVkNTQ0XHVjNjk0XHVkNTVjXH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ZS4gQWxsIHRpbWUgaW5kZXhlcyB3aWxsIGJlIGJldHdlZW4gMSBhbmQgMTAwLiZuYnNwOzxcL3A+XHJcbiIsIm91dHB1dCI6IjxwPk91dHB1dCB0aGUgb3ZlcmFsbCBjb3N0IG9mIEx1a2EmIzM5O3MgcGFya2luZyBoaXMgdGhyZWUgdHJ1Y2tzLiZuYnNwOzxcL3A+XHJcblxyXG48cD4mbmJzcDs8XC9wPlxyXG4iLCJoaW50IjoiIiwib3JpZ2luYWwiOiIxIiwicHJvYmxlbV9sYW5nX2NvZGUiOiJcdWM2MDFcdWM1YjQifV0=

출처

Contest > Croatian Open Competition in Informatics > COCI 2007/2008 > Contest #6 1번

  • 문제를 번역한 사람: baekjoon
  • 문제의 오타를 찾은 사람: jjacks