2761Add Add and Add

2761   Add Add and Add

题目描述

  There have two numbers n,m and two operators:

1. Cost a second(s), then number add 5

2. Cost b second(s), then number add 1

Please tell Jek The least cost that can make two numbers equal and the numbers can't beyond 10^6. Two numbers' operators are concurrent. 

输入格式:

  Input contains multiple test cases. Each test case start with 4 integers n, m(1<=n, m<=10^6)and a, b(1 <= a, b <= 100).

输出格式:

  For each test case, output the least cost

输入样例 复制
2 4 1 2
2 7 4 1
输出样例 复制
4
4

说明

6
30
通过提交
时空限制2000ms/64mb
题目来源
评测方式在线评测
题目类型
难        度