Here is yet another "is X NP-hard?" question.
The input of the problem is the following:
- A sequence of $n$ non-negative real numbers $\alpha_1, \ldots, \alpha_n$. Here $n$ is a positive natural number. If it makes any difference, I would also be fine with the assumptions that the $\alpha$'s are integers instead of reals.
- A non-negative real number $\beta$. (Again, this number could be integer if it makes any difference.)
- An integer number $d$ such that $1 \leq d < n$.
- An integer number $t$ such that $1 \leq t \leq n$.
The problem asks whether there is a subsequence of $(\alpha _1, \ldots, \alpha_n)$ of length at most $t$ such that:
- The sum of the elements in the subsequence is at least $\beta$. I.e., if the subsequence is $\alpha_{i_1}, \ldots, \alpha_{i_t}$, then $\sum_{j=1}^t \alpha_{i_j} \geq \beta$.
- There is no gap larger than $d$ in the subsequence. For example, if a number $\alpha_i$ is in the subsequence, it cannot happen than none of the numbers $\alpha_{i-d}, \ldots, \alpha_{i-1}, \alpha_{i+1}, \ldots, \alpha_{i+d}$ are in the sub-sequence. In other words, if two numbers $\alpha_i$, $\alpha_j$ are in the subsequence and $j > i + d$, then there must be at least another number in the subsequence among $\alpha_{i+1}, \ldots, \alpha_{j-1}$.
I spent quite some time on it, but I could not come up with any reduction from NP-complete problems I am familiar with. At the same time, I do not have a polynomial-time algorithm for it. The best I have is a pseudopolinomial-time dynamic programming algorithm which runs in $O(n \beta)$ (when $\beta$ is integer).