#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long int ll; using ull = unsigned long long; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n,m; cin >> n >> m; vector a(n); for(int i=0;i> a[i]; } a.push_back(0LL); ll now=0; ll sum=0; for(int i=0;i<=n;i++){ if(a[i]%2==0){ if(now>=m){ printf("%lld\n",sum ); } now=0; sum=0; } else{ now++; sum+=a[i]; } } }