#include <cstdio>
#include <cassert>
#include <cmath>
#include <algorithm>

using namespace std;

const double pi = 3.1415926535897932384626433832;
const double inf = 1e100;
const int maxn = 100010;

int n, k, r[maxn], d[maxn], a[maxn];

int main()
{
  freopen("moscow.in", "r", stdin);
  freopen("moscow.out", "w", stdout);

  assert(scanf("%d%d", &n, &k) == 2);
  assert(1 <= n && n <= 100000);
  assert(1 <= k && k <= 100000);
  for (int i = 0; i < n; i++)
  {
    assert(scanf("%d%d", &r[i], &d[i]) == 2);
    assert(1 <= r[i] && r[i] <= 1000000);
    assert(-1 <= d[i] && d[i] <= 1);
  }
  for (int i = 0; i < k; i++)
  {
    assert(scanf("%d", &a[i]) == 1);
    assert(0 <= a[i] && a[i] < 360 * 1000000);
  }
  int si, sj, ei, ej;
  assert(scanf("%d%d%d%d", &si, &sj, &ei, &ej) == 4);
  assert(1 <= si && si <= n);
  assert(1 <= sj && sj <= k);
  assert(1 <= ei && ei <= n);
  assert(1 <= ej && ej <= k);
  si--, sj--;
  ei--, ej--;
  double res = inf;
  for (int i = 0; i < n; i++)
  {
    double add = fabs(r[i] - r[si]) + fabs(r[i] - r[ei]);
    double di = inf;
    int t;
    if (d[i] != -1)
    {
      t = a[ej] - a[sj];
      if (t < 0) t += 360 * 1000000;
      di = min(di, t * 0.000001 / 180 * pi * r[i]);
    }
    if (d[i] != 1)
    {
      t = a[sj] - a[ej];
      if (t < 0) t += 360 * 1000000;
      di = min(di, t * 0.000001 / 180 * pi * r[i]);
    }
    res = min(res, di + add);
  }
  printf("%.20lf\n", res);

  return 0;
}
