#include "bits/stdc++.h" #define in std::cin #define out std::cout #define rep(i,N) for(LL i=0;i> N >> M; std::vectorA(N); rep(i, N) in >> A[i]; rep(i, N) { LL sum = 0; for (LL j = i; j < N; ++j) { if (A[j] % 2 == 0) { if (sum > 0) out << sum << std::endl; i = j; break; } sum += A[j]; if (j == N - 1) { if (sum > 0) out << sum << std::endl; i = j; break; } } } }