分析:
没啥好说的
CODE:
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#define OvO 0
using namespace std;
typedef long long ll;
const int N=1e5+5;
ll n,x,y,a[N],b[N],ans;
int main(){
scanf("%lld%lld%lld",&n,&x,&y);
for(int i=1;i<=n;i++)
scanf("%lld%lld",&a[i],&b[i]);
sort(a+1,a+n+1);
sort(b+1,b+n+1);
for(int i=1;i<=n;i++)
{
if(!(a[i]^b[i])) continue;
ans+=(a[i]<b[i])?abs(a[i]-b[i])*x:abs(a[i]-b[i])*y;
}
printf("%lld",ans);
return OvO;
}