#include <cstdio> #include <cstdlib> #include <cstring> #include <vector> #include <queue> #include <algorithm> using namespace std; #define AGE_MAX 200 class People { public: char name[9]; int worth; int age; int idx; People(const char* _name, int _worth = 0, int _age = 0) { strcpy(name, _name); worth = _worth; age = _age; idx = 0; } }; bool people_compare(const People* a, const People* b) { if (a->worth > b->worth) { return true; } else if (a->worth < b->worth) { return false; } if (a->age < b->age) { return true; } else if (a->age > b->age) { return false; } return strcmp(a->name, b->name) < 0; } class mycmp { public: bool operator() (const People* a, const People* b) { return !people_compare(a, b); } }; int main() { int N = 0, K = 0; scanf("%d%d", &N, &K); vector<vector<People*> > peoples(AGE_MAX + 1); char name[10] = {'