1 solutions

  • 0
    @ 2026-4-8 17:25:10

    #include<bits/stdc++.h> using namespace std; int main(){ int n,x; cin>>n>>x; int a,b; int max=-1; int maxx=-1; for(int i=0;i<n;i++){ cin>>a>>b; if(a-b>max){ max=a-b; } if(a>maxx){ maxx=a; } } int l=0; int cnt=0; while(l<=x-maxx){ cnt++; l=l+max; } cout<<cnt+1; return 0; }

    Information

    ID
    1606
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    7
    Tags
    (None)
    # Submissions
    71
    Accepted
    14
    Uploaded By