#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
using namespace std;
long long q[10004][2],answer=0;
int number,p;
int main()
{
freopen ("factory.in","r",stdin);
freopen ("factory.out","w",stdout);
scanf("%d%d",&number,&p);
for (int i=0;i<number;i++)
{
cin>>q[i][0]>>q[i][1];
}
for (int i=0;i<number;i++)
{
long long temp;
temp=q[i][0]*q[i][1];
for (int j=i-1;j>=0;j--)
{
if (q[j][0]*q[i][1]+(i-j)*p*q[i][1]<temp)
{
temp=q[j][0]*q[i][1]+(i-j)*p*q[i][1];
}
}
answer+=temp;
}
cout<<answer;
return 0;
}