Hints: Sum of Fractions
Answer to Hint 1: Decreasing the denominator increases the fraction more (e.g. $\frac{1}{d} \to \frac{1}{d-1}$ is a bigger gain than $\frac{1}{d} \to \frac{2}{d}$ when $d$ is small). So to maximize the sum of fractions, you typically want to apply as many “denominator decrease” operations as possible to the fraction(s) with the smallest denominator, then possibly add numerator increases.
For $\mathrm{MSF}(b, k)$, a natural strategy is: always choose the fraction with the smallest current denominator to increase (and prefer decreasing its denominator if $y > 1$). This greedy can be analyzed to get a closed form.
Answer to Hint 2: For a fixed subarray, the optimal strategy leads to a formula for $\mathrm{MSF}(a[l..r], k)$ that depends on the minimum value in the subarray and the sum of $\frac{1}{a_i}$ over the subarray, plus corrections that depend on $k$ and which element is minimum.
So the answer for a given $k$ is $\sum_{l,r} \mathrm{MSF}(a[l..r], k)$. You need to sum over all subarrays. How can you avoid iterating over all $O(n^2)$ subarrays?