#include #include #include #include #include using namespace std; int main() { int n; cin >> n; map mp; for (int i=0; i> no >> m >> s; for (int j=0; j> tag; mp[tag]+=s; } } vector> pa; for (auto itr=mp.begin(); itr!=mp.end(); itr++) { pa.push_back(pair(itr->first, itr->second)); } sort(pa.begin(), pa.end(), [](auto &left, auto &right) {return left.second==right.second ? left.firstright.second;}); int size=pa.size()>10 ? 10: pa.size(); for (int i=0; i