uses
  math;

const
  allang = 360 * 1000000;
  maxn = 100000;
  maxr = 1000000;

var
  r, d, a : array[1..maxn] of integer;
  rs, ast, rf, af, i, n, m, dir, ang : integer; 
  t, ans : double;

begin
  reset(input, 'moscow.in');
  rewrite(output, 'moscow.out');
  read(n, m);
  assert((1 <= n) and (n <= maxn));
  assert((1 <= m) and (m <= maxn));
  for i := 1 to n do begin
    read(r[i], d[i]);
    assert((1 <= r[i]) and (r[i] <= maxr));
    assert((-1 <= d[i]) and (d[i] <= 1));
  end;
  for i := 1 to m do begin
    read(a[i]);
    assert((0 <= a[i]) and (a[i] < allang));
  end;
  read(rs, ast, rf, af);
  assert((1 <= rs) and (rs <= n));
  assert((1 <= rf) and (rf <= n));
  assert((1 <= ast) and (ast <= m));
  assert((1 <= af) and (af <= m));
  ans := 1e9;
  for i := 1 to n do begin
    ang := (a[af] - a[ast] + allang) mod (allang);
    dir := 1;
    if (ang < allang div 2) then begin
      dir := -1;
    end else begin
      ang := allang - ang;
    end;
    if (dir = d[i]) then begin
      ang := allang - ang;
    end;
    if (af = ast) then begin
      ang := 0;
    end;
    t := abs(r[rf] - r[i]) + abs(r[rs] - r[i]);
    t := t + ang / allang * 2 * pi * r[i];
    ans := min(ans, t);
  end;
  writeln(ans : 0 : 9);
end.