// {{{1 extern "C" int __lsan_is_turned_off() { return 1; } #include using namespace std; #include using namespace tr2; #include #define ll long long #define inf 0x3f3f3f3f #define infl 0x3f3f3f3f3f3f3f3fll #include #ifdef DEBUG #define dprintf(args...) fprintf(stderr,args) #endif #ifndef DEBUG #define dprintf(args...) 69 #endif #define all(x) (x).begin(), (x).end() struct cintype { template operator T() { T x; cin>>x; return x; } }; // 1}}} cintype in; int main() { int n=in,k=in; vector a(n);for(auto&x:a)x=in; sort(all(a));reverse(all(a)); int turn=0; ll ans=0; for(auto x:a) { if(x<=k) { if(turn==0) ans+=x; turn^=1; } } while(a.size()&&a.back()<=k) a.pop_back(); for(auto x:a)if(~x&1) { ans+=x/2; turn^=1; } for(auto x:a) if(x&1) { if(turn==0)ans+=x/2; else ans+=x/2+1; turn^=1; } printf("%lld\n",ans); }