#include #include #include #define rep(i,a,b) for(int i=int(a);i> N; vector> V(N); vector> num(N); rep(i,0,N){ int a,b; cin >> a >> b; num[i] = make_pair(a,b); V[i] = make_pair((double) a/b, i); } sort(V.rbegin(), V.rend()); rep(i,0,N){ int idx = V[i].second; cout << num[idx].first << " " << num[idx].second << endl; } }