#include using namespace std; #define int long long signed main(){ int N; cin>>N; map> m; vector S(N); for(int i=0;i>a>>b; m[a*1.0/b] = {a,b}; S[i] = a*1.0/b; } sort(S.rbegin(),S.rend()); for(int i=0;i