#include #include #include using namespace std; typedef pair Paint; bool bunsu(const Paint&pf, const Paint&ps){ return pf.first*ps.second > ps.first*pf.second; } int main(){ int n;cin>>n; vector a; for(int i = 0; n > i; i++){ int x,y;cin>>x>>y; a.push_back(make_pair(x,y)); } sort(a.begin(),a.end(),bunsu); for(int i = 0; n > i; i++){ cout << a[i].first << " " << a[i].second << endl; } }