program ex(f1,f2);
type
zn=array [1..20000] of longint;
var
s,w:zn; i,j,k,m,n,l,p:longint;
f1,f2:text; ans,now:int64;
begin
assign(f1,'factory.in'); reset(f1);
assign(f2,'factory.out'); rewrite(f2);
readln(f1,n,p);
for i:=1 to n do readln(f1,w[i],s[i]);
ans:=0;
for i:=n downto 1 do
begin
now:=99999999999999999;
for j:=i downto 1 do
if (s[i]*w[j]+(i-j)*p*s[i])<now then now:=s[i]*w[j]+(i-j)*p*s[i];
ans:=ans+now;
end;
writeln(f2,ans);
close(f1);
close(f2);
end.