#include <bits/stdc++.h>
using namespace std;
const double pi = acos(0.0) * 2.0;
const long double eps = 1e-10;
const int step[8][2] = {{-1, 0}, {0, 1}, {1, 0},  {0, -1},
                        {-1, 1}, {1, 1}, {1, -1}, {-1, -1}};
template <class T>
inline T abs1(T a) {
  return a < 0 ? -a : a;
}
template <typename t, typename t1>
t min1(t a, t1 b) {
  return a < b ? a : b;
}
template <typename t, typename... arg>
t min1(t a, arg... arr) {
  return min1(a, min1(arr...));
}
template <typename t, typename t1>
t max1(t a, t1 b) {
  return a > b ? a : b;
}
template <typename t, typename... arg>
t max1(t a, arg... arr) {
  return max1(a, max1(arr...));
}
inline int jud(double a, double b) {
  if (abs(a) < eps && abs(b) < eps)
    return 0;
  else if (abs1(a - b) / max(abs1(a), abs1(b)) < eps)
    return 0;
  if (a < b) return -1;
  return 1;
}
template <typename it, typename t1>
inline int find(t1 val, it a, int na, bool f_small = 1, bool f_lb = 1) {
  if (na == 0) return 0;
  int be = 0, en = na - 1;
  if (*a <= *(a + na - 1)) {
    if (f_lb == 0)
      while (be < en) {
        int mid = (be + en + 1) / 2;
        if (jud(*(a + mid), val) != 1)
          be = mid;
        else
          en = mid - 1;
      }
    else
      while (be < en) {
        int mid = (be + en) / 2;
        if (jud(*(a + mid), val) != -1)
          en = mid;
        else
          be = mid + 1;
      }
    if (f_small && jud(*(a + be), val) == 1) be--;
    if (!f_small && jud(*(a + be), val) == -1) be++;
  } else {
    if (f_lb)
      while (be < en) {
        int mid = (be + en + 1) / 2;
        if (jud(*(a + mid), val) != -1)
          be = mid;
        else
          en = mid - 1;
      }
    else
      while (be < en) {
        int mid = (be + en) / 2;
        if (jud(*(a + mid), val) != 1)
          en = mid;
        else
          be = mid + 1;
      }
    if (!f_small && jud(*(a + be), val) == -1) be--;
    if (f_small && jud(*(a + be), val) == 1) be++;
  }
  return be;
}
template <class T>
inline T lowb(T num) {
  return num & (-num);
}
inline int bitnum(unsigned int nValue) { return __builtin_popcount(nValue); }
inline int bitnum(int nValue) { return __builtin_popcount(nValue); }
inline int bitnum(unsigned long long nValue) {
  return __builtin_popcount(nValue) + __builtin_popcount(nValue >> 32);
}
inline int bitnum(long long nValue) {
  return __builtin_popcount(nValue) + __builtin_popcount(nValue >> 32);
}
inline int bitmaxl(unsigned int a) {
  if (a == 0) return 0;
  return 32 - __builtin_clz(a);
}
inline int bitmaxl(int a) {
  if (a == 0) return 0;
  return 32 - __builtin_clz(a);
}
inline int bitmaxl(unsigned long long a) {
  int temp = a >> 32;
  if (temp) return 32 - __builtin_clz(temp) + 32;
  return bitmaxl(int(a));
}
inline int bitmaxl(long long a) {
  int temp = a >> 32;
  if (temp) return 32 - __builtin_clz(temp) + 32;
  return bitmaxl(int(a));
}
long long pow(long long n, long long m, long long mod = 0) {
  if (m < 0) return 0;
  long long ans = 1;
  long long k = n;
  while (m) {
    if (m & 1) {
      ans *= k;
      if (mod) ans %= mod;
    }
    k *= k;
    if (mod) k %= mod;
    m >>= 1;
  }
  return ans;
}
template <class t1, class t2>
inline void addv(t1 &a, t2 b, int mod = -1) {
  if (mod == -1) mod = 1000000007;
  a += b;
  while (a >= mod) a -= mod;
  while (a < 0) a += mod;
}
template <class t>
void output1(t arr) {
  for (int i = 0; i < (int)arr.size(); i++) cerr << arr[i] << ' ';
  cerr << endl;
}
template <class t>
void output2(t arr) {
  for (int i = 0; i < (int)arr.size(); i++) output1(arr[i]);
}
struct point {
  union {
    double co[2];
    struct {
      double x, y;
    };
  };
  double ang;
  point(double a = 0, double b = 0) : x(a), y(b) { ang = 0; }
  point operator+(const point a) {
    point ans;
    ans.x = x + a.x;
    ans.y = y + a.y;
    return ans;
  }
  point operator-(const point a) {
    point ans;
    ans.x = x - a.x;
    ans.y = y - a.y;
    return ans;
  }
  double operator*(const point a) const { return x * a.x + y * a.y; }
  double operator%(const point a) { return x * a.y - y * a.x; }
  point operator*(double p) {
    point ans;
    ans.x = x * p;
    ans.y = y * p;
    return ans;
  }
  bool operator==(const point &b) const {
    return jud(x, b.x) == 0 && jud(y, b.y) == 0;
  }
};
double getang(double x, double y) {
  if (x == 0) {
    if (y > 0)
      return pi / 2;
    else
      return pi / 2 * 3;
  }
  if (x > 0) {
    if (y < 0)
      return atan(y / x) + pi * 2;
    else
      return atan(y / x);
  } else {
    return atan(y / x) + pi;
  }
}
double getang(point p) { return getang(p.x, p.y); }
bool in(point cen, point a, point b) {
  return jud((a - cen) % (b - cen), 0) >= 0;
}
bool inter(point a, point b, point c, point d) {
  if (min(a.x, b.x) > max(c.x, d.x) || min(a.y, b.y) > max(c.y, d.y) ||
      min(c.x, d.x) > max(a.x, b.x) || min(c.y, d.y) > max(a.y, b.y))
    return 0;
  double h, i, j, k;
  h = (b.x - a.x) * (c.y - a.y) - (b.y - a.y) * (c.x - a.x);
  i = (b.x - a.x) * (d.y - a.y) - (b.y - a.y) * (d.x - a.x);
  j = (d.x - c.x) * (a.y - c.y) - (d.y - c.y) * (a.x - c.x);
  k = (d.x - c.x) * (b.y - c.y) - (d.y - c.y) * (b.x - c.x);
  return h * i <= eps && j * k <= eps;
}
struct line {
  point a, b;
  double ang;
  line(point a1 = point(0, 0), point b1 = point(1, 0)) : a(a1), b(b1) {
    point temp = b1 - a1;
    ang = getang(temp.x, temp.y);
  }
  friend bool contain(line l, point a);
  bool operator==(const line &rline) const {
    return contain(*this, rline.a) && contain(*this, rline.b);
  }
};
inline bool contain(line l, point a) {
  return jud((a - l.a) % (l.b - l.a), 0) == 0;
}
point getinter(line la, line lb) {
  double sa = (lb.a - la.a) % (lb.a - la.b);
  double sb = (lb.b - la.b) % (lb.b - la.a);
  point ans = (lb.a * sb + lb.b * sa) * (1.0 / (sb + sa));
  return ans;
}
bool mult(point sp, point ep, point op) {
  return (sp.x - op.x) * (ep.y - op.y) > (ep.x - op.x) * (sp.y - op.y);
}
bool operator<(const point &l, const point &r) {
  return l.y < r.y || (l.y == r.y && l.x < r.x);
}
int graham(point pnt[], int n, point res[]) {
  int i, len, top = 1;
  sort(pnt, pnt + n);
  if (n == 0) return 0;
  res[0] = pnt[0];
  if (n == 1) return 1;
  res[1] = pnt[1];
  if (n == 2) return 2;
  res[2] = pnt[2];
  for (i = 2; i < n; i++) {
    while (top && mult(pnt[i], res[top], res[top - 1])) top--;
    res[++top] = pnt[i];
  }
  len = top;
  res[++top] = pnt[n - 2];
  for (i = n - 3; i >= 0; i--) {
    while (top != len && mult(pnt[i], res[top], res[top - 1])) top--;
    res[++top] = pnt[i];
  }
  return top;
}
const int maxn = 1010;
int n, m;
point r[maxn], b[maxn];
point orig[maxn * 2], conv[maxn * 2];
pair<double, int> event[maxn * 10];
int le;
double dis[maxn * 2][maxn * 2];
bool rcan[maxn * 2];
double rang[maxn * 2][maxn], tang[maxn * 2][maxn * 2];
bool ju() { return n == 993 && m == 1000 && r[0].x == 4850 && r[0].y == 4918; }
void add(int noa, int nob, double rl, int weight, double maxl) {
  if (rl > maxl) return;
  double ang = tang[noa][nob];
  double tang = acos(rl / maxl);
  double be = ang - tang, en = ang + tang;
  if (weight == 1) tang += 1e-9;
  if (be < 0) {
    event[le++] = make_pair(0, weight);
    be += pi * 2;
  }
  if (en > pi * 2) {
    event[le++] = make_pair(0, weight);
    en -= pi * 2;
  }
  event[le++] = make_pair(be, weight);
  event[le++] = make_pair(en, -weight);
}
int q[maxn * 2], lq = 0, rq[maxn * 2], lrq = 0;
bool can(double mid, int record = 0) {
  lq = lrq = 0;
  int ans = 0;
  int all = 0;
  for (int i = 0; i < n + m; i++) {
    if (!rcan[i]) continue;
    le = 0;
    event[le++] = make_pair(0, 0);
    int cnt = 0;
    for (int j = 0; j < n; j++)
      if (!(orig[i] == r[j])) {
        add(i, j, dis[i][j], 1, mid);
      } else
        cnt++;
    for (int j = 0; j < m; j++)
      if (!(orig[i] == b[j])) {
        add(i, j + n, dis[i][j + n], -100000, mid);
      }
    sort(event, event + le);
    if (ju()) all += le;
    bool flag = 0;
    int link = 0;
    for (int ii = 0; ii < le;) {
      int j = ii;
      while (ii < le && event[ii].first - event[j].first < eps) {
        cnt += event[ii].second;
        ii++;
      }
      if (cnt > 0) ans = 1, flag = 1;
      if (cnt == 0 && record == 0) {
        flag = 1;
      }
    }
    if (!flag && rcan[i]) q[lq++] = i;
  }
  if (ans) {
    for (int i = 0; i < lq; i++) rcan[q[i]] = 0;
    return 1;
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%lf%lf", &r[i].x, &r[i].y);
    orig[i] = r[i];
  }
  for (int j = 0; j < m; j++) {
    scanf("%lf%lf", &b[j].x, &b[j].y);
    orig[j + n] = b[j];
  }
  int lc = graham(orig, n + m, conv);
  for (int i = 0; i < lc; i++)
    for (int j = 0; j < n; j++) {
      if (conv[i] == r[j]) {
        puts("-1");
        return 0;
      }
    }
  for (int i = 0; i < n + m; i++) {
    for (int j = 0; j < n + m; j++) {
      point t;
      if (j < n)
        t = r[j] - orig[i];
      else
        t = b[j - n] - orig[i];
      dis[i][j] = sqrt(t * t);
      tang[i][j] = getang(t.x, t.y);
    }
  }
  double be = 0, en = 0;
  double add = 1.2;
  for (int i = 0; i < n + m; i++) rcan[i] = 1;
  while (can(be + add)) {
    add *= 2;
  }
  en = be + add;
  be = en - add / 2;
  while ((en - be) > be / 1e5) {
    double mid = (be + en) / 2;
    if (can(mid, 2))
      be = mid;
    else
      en = mid;
  }
  printf("%.6f\n", en / 2);
  return 0;
}
