#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-12;
const int maxn = 1010;
struct point {
  long double x, y;
  point() {}
  point(long double a, long double b) { x = a, y = b; }
  point operator+(const point &a) const { return point(x + a.x, y + a.y); }
  point operator-(const point &a) const { return point(x - a.x, y - a.y); }
  long double operator*(const point &a) const { return x * a.y - y * a.x; }
  point operator*(const long double &a) const { return point(x * a, y * a); }
} p[maxn << 1];
struct line {
  point p, v;
  line() {}
  line(point a, point b) { p = a, v = b; }
};
struct node {
  long double x;
  int k;
  node() {}
  node(double a, int b) { x = a, k = b; }
} q[maxn << 3];
int n, m, tot;
inline long double dis(point a, point b) {
  return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
}
long double getrange(point a, point b, long double R) {
  long double d = dis(a, b) / 2;
  return acos(d / R);
}
bool cmp(const node &a, const node &b) { return a.x < b.x; }
inline bool solve(int x, long double R) {
  int i;
  tot = 0;
  if (x <= n)
    q[++tot] = node(-acos(-1.0), 1), q[++tot] = node(acos(-1.0), -1);
  else {
    for (i = 1; i <= n; i++) {
      if (dis(p[i], p[x]) > R + R - eps) continue;
      long double a = getrange(p[x], p[i], R),
                  b = atan2(p[i].y - p[x].y, p[i].x - p[x].x);
      long double c = b - a, d = b + a;
      if (c < -acos(-1.0)) c += 2 * acos(-1.0);
      if (d > acos(-1.0)) d -= 2 * acos(-1.0);
      if (c < d)
        q[++tot] = node(c, 1), q[++tot] = node(d, -1);
      else
        q[++tot] = node(-acos(-1.0), 1), q[++tot] = node(d, -1),
        q[++tot] = node(c, 1), q[++tot] = node(acos(-1.0), -1);
    }
  }
  for (i = n + 1; i <= n + m; i++) {
    if (dis(p[i], p[x]) > R + R - eps) continue;
    long double a = getrange(p[x], p[i], R),
                b = atan2(p[i].y - p[x].y, p[i].x - p[x].x);
    long double c = b - a, d = b + a;
    if (c < -acos(-1.0)) c += 2 * acos(-1.0);
    if (d > acos(-1.0)) d -= 2 * acos(-1.0);
    if (c < d)
      q[++tot] = node(c, -10000), q[++tot] = node(d, 10000);
    else
      q[++tot] = node(-acos(-1.0), -10000), q[++tot] = node(d, 10000),
      q[++tot] = node(c, -10000), q[++tot] = node(acos(-1.0), 10000);
  }
  sort(q + 1, q + tot + 1, cmp);
  int tmp = 0;
  for (i = 1; i <= tot; i++) {
    if (tmp > 0 && i != 1 && q[i].x > q[i - 1].x + eps) return 1;
    tmp += q[i].k;
  }
  return 0;
}
inline bool check(long double mid) {
  for (int i = 1; i <= n + m; i++)
    if (solve(i, mid)) return 1;
  return 0;
}
inline int rd() {
  int ret = 0, f = 1;
  char gc = getchar();
  while (gc < '0' || gc > '9') {
    if (gc == '-') f = -f;
    gc = getchar();
  }
  while (gc >= '0' && gc <= '9') ret = ret * 10 + (gc ^ '0'), gc = getchar();
  return ret * f;
}
int main() {
  n = rd(), m = rd();
  if (m == 1) {
    puts("-1");
    return 0;
  }
  int i;
  for (i = 1; i <= n; i++) p[i].x = rd(), p[i].y = rd();
  random_shuffle(p + 1, p + n + 1);
  for (i = 1; i <= m; i++) p[i + n].x = rd(), p[i + n].y = rd();
  random_shuffle(p + n + 1, p + m + 1);
  long double l = 0, r, mid;
  for (i = 1; i <= n + m; i++)
    if (solve(i, l)) {
      r = 1e9;
      while (r - l > 1e-5) {
        mid = (l + r) / 2;
        if (solve(i, mid))
          l = mid;
        else
          r = mid;
      }
    }
  if (l > 1e9 - 1)
    puts("-1");
  else
    printf("%.18Lf", l);
  return 0;
}
