{{{ #include #include #include using namespace std; typedef struct ps { public: int first; int second; }ps; class opt { public: bool operator() (const ps &s1, const ps &s2) { int a = s1.first * s2.second; int b = s1.second * s2.first; return a < b; } }; int main() { int cs, line, t, s, key, val; ps p; multimap mm; multimap::iterator it; cin>>cs; while(cs--) { cin>>line; for(int i=0; i>t>>s; p.first = t; p.second = s; mm.insert(make_pair(p, i+1)); } for(it = mm.begin(); it != mm.end(); ++it) cout<second<<" "; cout<