#include using namespace std; #define all(x) (x).begin(),(x).end() #define SP <<" "<< #define MOD 1000000007 #define IINF 1000000000 #define LINF 1000000000000000000 typedef long long LL; typedef long double LD; int main(){ int n,m; cin >> n >> m; LL total=0; int count=0; LL a; for(int i=0;i> a; if(a%2){ count++; total+=a; }else{ if(count!=0){ if(count>=m) cout << total << endl; count=0; total=0; } } } if(count!=0) if(count>=m) cout << total << endl; return 0; }