#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int N, M; cin >> N >> M; vector A(N); for (int i = 0; i < N; i++) { cin >> A[i]; } int64_t sum = 0; for (int i = 0; i < N; i++) { if (A[i] % 2 == 0) continue; int cnt = 0; while (i < N && A[i] % 2 != 0) { sum += A[i]; i++; cnt++; } if (cnt >= M) cout << sum << '\n'; sum = 0; } return 0; }