ll@n,@k,x[n+2],y[]; rd((x,y)(n+2)); DijkstraHeaph; h.malloc((n+2)*(n+2),1); priority_queue>>q; h.change(0,0); while(true){ ll i=h.pop(); ll v=h.val[i]; q.push({v,{v,1}}); if(i==1){ break; } rep(j,n+2){ h.change(j,abs(x[j]-x[i])+abs(y[j]-y[i])); } } rep(k){ auto a=q.top(); q.pop(); q.push({a.second.first/+(a.second.second+1),{a.second.first,a.second.second+1}}); } wt(q.top().first);