Minimum Time to Break Locks I

Given an array strength and an integer K, find the minimum total time for one sword to break every lock. The sword starts with energy 0 and power 1. During each minute its energy increases by its current power. Breaking a lock of strength strength[i] takes ceil(strength[i] / power) minutes, then energy resets to zero and power increases by K. Locks may be broken in any order.

Examples
Input: [[3,4,1],1]
Output: 4
Hints

Minimum Time to Break Locks I

Given an array `strength` and an integer `K`, find the minimum total time for one sword to break every lock. The sword starts with energy `0` and power `1`. During each minute its energy increases by its current power. Breaking a lock of strength `strength[i]` takes `ceil(strength[i] / power)` minutes, then energy resets to zero and power increases by `K`. Locks may be broken in any order.