program ball;
constthu:int64=1000;
typepoint=recordx,v:longint;end;
varn,x0,i,j,k,t1,t2,d1,d2:longint;ans:int64;s1,s2,bal:array [0..1001] of point;f:array [0..1,0..1001,0..1001] of int64;w1,w2:array [0..1001] of int64;procedure swap (var a,b:point);
vari:point;
begini:=a;a:=b;b:=i;
end;procedure qsort (s,e:longint);
vari,j,k:longint;
beginif s>=e then exit;i:=s;j:=e;k:=bal[(s+e) div 2].x;while i<=j dobeginwhile bal[i].x<k do inc(i);while bal[j].x>k do dec(j);if i>j then break;swap(bal[i],bal[j]);inc(i);dec(j);end;qsort(s,j);qsort(i,e);
end;beginassign(input,'ball.in');reset(input);assign(output,'ball.out');rewrite(output);read(n,x0);ans:=0;for i:=1 to n doread(bal[i].x);for i:=1 to n dobeginread(k);ans:=ans+k;end;for i:=1 to n doread(bal[i].v);qsort(1,n);t1:=0;d1:=0;for i:=n downto 1 doif bal[i].x<x0 thenbeginif (t1>0)and(bal[i].x=s1[t1].x) thens1[t1].v:=s1[t1].v+bal[i].velsebegininc(t1);s1[t1]:=bal[i];end;d1:=d1+bal[i].v;end;t2:=0;d2:=0;for i:=1 to n doif bal[i].x>x0 thenbeginif (t2>0)and(bal[i].x=s2[t2].x) thens2[t2].v:=s2[t2].v+bal[i].velsebegininc(t2);s2[t2]:=bal[i];end;d2:=d2+bal[i].v;end;fillchar(f,sizeof(f),63);s1[0].x:=x0;for i:=t1 downto 0 dow1[i]:=w1[i+1]+s1[i].v;for i:=t2 downto 1 dow2[i]:=w2[i+1]+s2[i].v;s1[t1+1].x:=s1[t1].x;s2[t2+1].x:=s2[t2].x;f[0,0,1]:=0;for i:=0 to t1+1 dofor j:=1 to t2+1 dobeginif (i=t1+1)and(j=t2+1) then continue;if (i<>t1+1)and(i>0)and(f[0,i,j]>f[0,i-1,j]+(w1[i]+w2[j])*(s1[i-1].x-s1[i].x)) thenf[0,i,j]:=f[0,i-1,j]+(w1[i]+w2[j])*(s1[i-1].x-s1[i].x);if (j<>t2+1)and(i>0)and(f[1,i,j]>f[0,i-1,j]+(w1[i]+w2[j])*(s2[j].x-s1[i-1].x)) thenf[1,i,j]:=f[0,i-1,j]+(w1[i]+w2[j])*(s2[j].x-s1[i-1].x);if (i<>t1+1)and(j>1)and(f[0,i,j]>f[1,i,j-1]+(w1[i]+w2[j])*(s2[j-1].x-s1[i].x)) thenf[0,i,j]:=f[1,i,j-1]+(w1[i]+w2[j])*(s2[j-1].x-s1[i].x);if (j<>t2+1)and(j>1)and(f[1,i,j]>f[1,i,j-1]+(w1[i]+w2[j])*(s2[j].x-s2[j-1].x)) thenf[1,i,j]:=f[1,i,j-1]+(w1[i]+w2[j])*(s2[j].x-s2[j-1].x);end;if ans-f[0,t1,t2+1]>ans-f[1,t1+1,t2] then ans:=ans-f[0,t1,t2+1]else ans:=ans-f[1,t1+1,t2];writeln(ans/1000:0:3);close(input);close(output);
end.