제출 #88967

#제출 시각아이디문제언어결과실행 시간메모리
88967nika학교 설립 (IZhO13_school)C++17
0 / 100
201 ms620 KiB
#include <bits/stdc++.h>

using namespace std;
long long int a,i,b,c,d,e,n=0;
int main()
{
    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...