Help me! Maximum subsequence sum such that no K elements are consecutive

Please help me, the statement of this problem is find the maximum subsequence sum such that no K elements are consecutive with k <= n <= 10^6