#d11005. 硬币

硬币

Coins

Problem Description

You are given NN coin denominations A1A_1 through ANA_N, where 1=A1≤A2≤⋯≤AN−1≤AN1 = A_1 \le A_2 \le \dots \le A_{N-1} \le A_N and for 2≤i≤N2 \le i \le N, AiA_i is a multiple of Ai−1A_{i-1}. Find the minimum of (number of coins spent) + (number of coins given as change) such that the sum of the spent coins is ≥X\ge X and (sum of spent coins) −- (sum of change coins) =X= X.

Input Format

The first line contains two integers N,XN, X.

The second line contains NN integers A1A_1 through ANA_N. It is guaranteed that A1=1A_1 = 1 and Ai>Ai−1A_i > A_{i-1}.

Output Format

One line with one integer — the minimum total number of coins.

Sample Input

3 87
1 10 100

Sample Output

5

Constraints

  • 1≤N≤601 \le N \le 60.
  • 1=A1<⋯<AN≤1×1091 = A_1 < \dots < A_N \le 1 \times 10^9.
  • 1≤X≤1×1091 \le X \le 1 \times 10^9.
  • For 2≤i≤N2 \le i \le N, AiA_i is a multiple of Ai−1A_{i-1}.