cswork / OA打开练习工作台

Wells FargoOA #4

Compressing Array

估计中等可在线判题

考点(AI 标注)贪心调度

You may repeatedly merge two adjacent elements, replacing them with their product; a merge is allowed only when the product is ≤k. All elements are positive integers. Find the shortest array length reachable after any sequence of operations.

输入格式

The first line contains n and k; the second line contains n positive integers a[i]. The original constraints are corrupted; this site adds: 1≤n≤200000, 1≤a[i]≤10^9, 1≤k≤10^18.

输出格式

Output the shortest possible length.

样例 1

输入:

6 20
2 3 3 7 3 5

输出:

3

样例 2

输入:

3 5
2 4 5

输出:

3

样例 3

输入:

3 1
1 1 1

输出:

1