Submission #88962

#TimeUsernameProblemLanguageResultExecution timeMemory
88962nikaSchools (IZhO13_school)C++14
0 / 100
206 ms628 KiB
#include <iostream>

using namespace std;

int main()
{
    int a,i,b,c,d,e,n=0;
    cin>>e>>a>>b;
    if(a+b>e){
        return 0;
    }
    for(i=1;i<=e;i++){
        cin>>c>>d;
        if(n<=c*a+d*b){
            n=c*a+d*b;
        }
    }
    if(a==b){
        n=n-a;
    }
    else
        n=n-1-max(a,b);
    cout<<n;
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...