#include using namespace std; using ll = long long; int main(){ ios::sync_with_stdio(false); cin.tie(0); int n, m; cin >> n >> m; vector ans, st; for(int i = 0; i < n; i++){ ll v; cin >> v; if(v % 2 == 0){ if(st.empty())continue; if(st.size() >= m){ ans.push_back(accumulate(st.begin(), st.end(), 0ll)); } st.clear(); }else{ st.push_back(v); } } if(st.size() >= m)ans.push_back(accumulate(st.begin(), st.end(), 0ll)); for(int i = 0; i < ans.size(); i++){ cout << ans[i] << '\n'; } }