#include using namespace std; typedef long long ll; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b>N>>K; vector A,B; ll pass=0,ans=0; for(int i=0;i>x; if(x<=K) A.push_back(x); else{ if(x%2==0){ ans+=x/2; pass++; }else{ B.push_back(x); } } } sort(all(A)); reverse(all(A)); for(int i=0;i