#include #include #include using namespace std; typedef long long int ll; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin >> n; vector a(n),b(n); vector > v; for(int i=0;i> a[i] >> b[i]; v.push_back(make_pair((double)a[i]/b[i],i)); } sort(v.begin(),v.end()); for(int i=n-1;i>=0;i--){ cout << a[v[i].second] << " " << b[v[i].second] << endl; } }