program factory;
const
maxf=1000000;
var
n,s:longint;
c,y:array[1..10000]of longint;
f:array[1..maxf] of longint;
ans:int64;
procedure init;
var
i:longint;
begin
assign(input,'factory.in');
reset(input);
assign(output,'factory.out');
rewrite(output);
readln(n,s);
for i:=1 to n do
readln(c[i],y[i]);
close(input);
fillchar(f,sizeof(f),0);
fillchar(ans,sizeof(ans),0);
end;
procedure main;
var
i,k,t:longint;
begin
f[1]:=c[1]*y[1];
for i:=2 to n do
begin
f[i]:=c[i]*y[i];
for k:=1 to i-1 do
begin
t:=c[k]*y[i]+s*y[i]*(i-k);
if t<=f[i] then f[i]:=t;
end;
end;
end;
procedure print;
var
i:longint;
begin
for i:=1 to n do ans:=ans+f[i];
writeln(ans);
close(output);
halt;
end;
begin
init;
main;
print;
end.