#d11005. 硬币
硬币
Coins
Problem Description
You are given coin denominations through , where and for , is a multiple of . Find the minimum of (number of coins spent) + (number of coins given as change) such that the sum of the spent coins is and (sum of spent coins) (sum of change coins) .
Input Format
The first line contains two integers .
The second line contains integers through . It is guaranteed that and .
Output Format
One line with one integer — the minimum total number of coins.
Sample Input
3 87
1 10 100
Sample Output
5
Constraints
- .
- .
- .
- For , is a multiple of .