#include <bits/stdc++.h>
using namespace std;
const int N = 1e4;
const double lim = 1e-5;
const double eps = 1e-10;
int gi() {
  int w = 0;
  bool q = 1;
  char c = getchar();
  while ((c < '0' || c > '9') && c != '-') c = getchar();
  if (c == '-') q = 0, c = getchar();
  while (c >= '0' && c <= '9') w = w * 10 + c - '0', c = getchar();
  return q ? w : -w;
}
const double pi = acos(-1);
struct P {
  double x, y;
  inline double angle() { return atan2(y, x); }
  inline double mo() { return sqrt(x * x + y * y); }
} p[N];
inline P operator-(const P& a, const P& b) { return (P){a.x - b.x, a.y - b.y}; }
int n, m;
struct Eve {
  double x, y;
  int tp;
  inline bool operator<(const Eve& b) const { return x < b.x; }
} eve[N];
inline bool check(const P& o, double r) {
  int i;
  double e0 = -pi, e1 = -pi, dis, arg, d, L, R;
  for (i = 1; i <= n + m; i++)
    if ((dis = (p[i] - o).mo()) > eps) {
      if (dis > r * 2) {
        eve[i].tp = -1;
        continue;
      }
      arg = (p[i] - o).angle();
      d = acos(dis / 2 / r);
      if ((L = arg - d) < -pi) L += pi * 2;
      if ((R = arg + d) > pi) R -= pi * 2;
      if (L <= R)
        eve[i] = (Eve){L, R, i <= n};
      else {
        i <= n ? e0 = max(e0, R) : e1 = max(e1, R);
        eve[i] = (Eve){L, pi, i <= n};
      }
    } else if (eve[i].tp = -1, i <= n)
      e0 = pi;
  sort(eve + 1, eve + 1 + n + m);
  for (i = 1; i <= n + m; i++) {
    if (eve[i].tp == -1) continue;
    if (e1 < min(e0, eve[i].x) - eps) return true;
    eve[i].tp ? e0 = max(e0, eve[i].y) : e1 = max(e1, eve[i].y);
  }
  return e1 < e0 - eps;
}
int main() {
  n = gi(), m = gi();
  int i;
  double l = 0, r, mid;
  for (i = 1; i <= n + m; i++) p[i].x = gi(), p[i].y = gi();
  random_shuffle(p + 1, p + 1 + n);
  random_shuffle(p + n + 1, p + n + m + 1);
  for (i = 1; i <= n + m; i++)
    if (check(p[i], l)) {
      r = 1e9;
      while (r - l > lim)
        if (check(p[i], mid = (l + r) / 2))
          l = mid;
        else
          r = mid;
    }
  printf("%.10lf\n", l < 1e9 - lim ? l : -1);
  return 0;
}
