#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; bool ord(pair &x, pair &y){ return x.first - y.first + y.first * x.second - x.first * y.second > 0; } const ll modc = 1e9+7; int main(){ ll N, ans=0, lv=1, a, b; cin >> N; vector> AB(N); for (int i=0; i> AB[i].first; for (int i=0; i> AB[i].second; sort(AB.begin(), AB.end(), ord); for (int i=0; i