#include constexpr int INF = 2147483647; constexpr long long int INF_LL = 9223372036854775807; constexpr int MOD = 1000000007; using namespace std; typedef long long int ll; typedef unsigned long long int ull; random_device rnd; int main(int argc, char* argv[]) { ll N, M; cin >> N >> M; vector < vector < ll >> A; A.push_back(vector()); for (int i = 0; i < N; i++) { int tmp; cin >> tmp; if (tmp % 2 == 1) { A.back().push_back(tmp); } else { A.push_back(vector()); } } for (int i = 0; i < A.size(); i++) { if (A[i].size() >= M) { ll ans = 0; for(int j = 0; j < A[i].size(); j++)ans += A[i][j]; cout << ans << endl; } } }