#include #include #include #include #include #include #include using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(0); int n, m; cin >> n >> m; ll s = 0; int c = 0; for (int i = 0; i < n; i++) { int a; cin >> a; if (a % 2) { s += a; c++; } else if (s) { if (c >= m) cout << s << '\n'; s = 0; c = 0; } } if (s) if (c >= m) cout << s << '\n'; return 0; }