#include using namespace std; int main() { int N; cin >> N; vector> T(N); for (int i = 0; i < N; i++) { double a, b; cin >> a >> b; T.at(i) = make_tuple(a / b, a, b); } sort(T.rbegin(), T.rend()); for (int i = 0; i < N; i++) { cout << get<1>(T.at(i)) << " " << get<2>(T.at(i)) << "\n"; } }