#include using namespace std; int dist(vector const &a,vector const &b){ int res=0; for (int i=a.size(); i--;){ res+=abs(a[i]-b[i]); } return res; } int main(){ int n,l,k; cin>>n>>l>>k; vector names(n); vector> values(n,vector(l)); for (int i=0; i>names[i]; for (auto &j: values[i]) cin>>j; } vector keys(k); vector available(n,true); // For every point in the input, keep track of just what the closest point is // out of the ones that we selected so far. This only changes when a new point // is selected. vector worst(n); for (int i=n; i--;) worst[i]=dist(values[0],values[i]); for (int i=0; i best={-1,-1}; for (int j=0; jbest.first){ best={cost,j}; } } } if (i==0) worst.assign(n,INT_MAX); for (int j=n; j--;){ worst[j]=min(worst[j],dist(values[best.second],values[j])); } keys[i]=best.second; available[best.second]=false; cout<