#include #include using namespace std; int main(){ int n,k,w; map m; cin>>n>>k; for(int i=0; i>w; int y=0; int z=0; for(auto i=m.begin(); i!=m.end(); ++i){ int a=i->first; int b=i->second; if(a>=w){ y+=b; } if(a==w*-1){ z=b; } } if(w>=0){ if(y0){ if(m[w]>0){ m[w]-=1; } else { // } } else { // } } } int x=0; for(auto i=m.begin(); i!=m.end(); ++i){ int a=i->first; int b=i->second; x+=b; } cout<