program EmberAsh;
var
i,j,n,s:longint;
a:array[0..10000,1..2]of int64;
f:array[0..10000]of int64;
k,min:int64;
fin,fout:text;
BEGIN
assign(fin,'factory.in');reset(fin);
assign(fout,'factory.out');rewrite(fout);
readln(fin,n,s);
for i:=1 to n do
readln(fin,a[i,1],a[i,2]);
//min:=maxlongint;
for i:=1 to n do
begin
for j:=1 to i do
begin
k:=a[j,1]*a[i,2]+(i-j)*a[i,2]*s;
if (k<f[i])or(f[i]=0) then
f[i]:=k;
end;
end;
{for i:=1 to n do//第n件物品
begin
for j:=1 to i-1 do
begin
k:=
end;
end;}
min:=0;
for i:=1 to n do
min:=min+f[i];
writeln(fout,min);
close(fin);close(fout);
END.