#include "bits/stdc++.h" using namespace std; typedef long long ll; #define INF (1<<30) #define INFLL (1ll<<60) typedef pair P; typedef pair E; #define MOD (1000000007ll) #define l_ength size void mul_mod(ll& a, ll b){ a *= b; a %= MOD; } void add_mod(ll& a, ll b){ a += b; if(a>MOD){ a -= MOD; } } ll a,s; int main(void){ int n,m,cnt=0,i; cin >> n >> m; for(i=0; i> a; if(a%2){ ++cnt; s += a; }else{ if(cnt>=m){ cout << s << endl; } cnt = 0; s = 0ll; } } if(cnt>=m){ cout << s << endl; } return 0; }