1 solutions

  • 0
    @ 2025-7-3 14:05:20
    #include<bits/stdc++.h>
    using namespace std;
    const int N=50010;
    typedef long long LL;
    struct Node{
        LL sum,w,s;
        bool operator<(const Node& W)const
        {
            return sum<W.sum;
        }
    }cow[N];
    int main()
    {
        int n;
        cin>>n;
        n++;
        for(int i=0;i<n;i++)
        {
            cin>>cow[i].w>>cow[i].s;
            cow[i].sum=cow[i].w*cow[i].s;
        }
        sort(cow,cow+n);
        LL res=-2e18;
        LL ss=1;
        for(int i=1;i<n;i++)
        {
        //    cout<<cow[i].w<<" "<<cow[i].s<<endl;
            res=max(res,ss/cow[i].s);
            ss*=cow[i].w;
        }
        cout<<res;
        return 0;
    }
    
    
    

    Information

    ID
    255
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    8
    Tags
    # Submissions
    8
    Accepted
    3
    Uploaded By