#include "bits/stdc++.h" using namespace std; void solve() { long a, b, cur = 0, ser = 0; cin >> a >> b; while(a--) { long x; cin >> x; if (x & 1) { cur += x; ser++; } else { if (ser >= b) { cout << cur << endl; } cur = 0; } } if (ser >= b) { cout << cur << endl; } } int main() { solve(); //cout << "yui(*-v・)yui" << endl; return 0; }