#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
const double eps = 1e-10;
const int N = 2005;
pair<double, int> q[N * 5];
struct P {
  int x, y, c;
} a[N];
int n, m;
double sqr(double x) { return x * x; }
bool check(int id, double r) {
  int top = 0;
  if (a[id].c == 1) {
    q[++top] = pair<double, int>(0, -1);
    q[++top] = pair<double, int>(2 * pi, 1);
  }
  for (int i = (int)(1); i <= (int)(n + m); i++)
    if (i != id) {
      double ang = atan2(a[id].y - a[i].y, a[id].x - a[i].x);
      double R = sqr(a[id].y - a[i].y) + sqr(a[id].x - a[i].x);
      if (R > 4 * r * r) continue;
      if (a[i].c == 2 && R > 4 * r * r - eps) continue;
      double dif = acos(sqrt(R) / 2 / r);
      double le = ang - dif, ri = ang + dif;
      if (le < 0) le += 2 * pi;
      if (le > 2 * pi) le -= 2 * pi;
      if (ri < 0) ri += 2 * pi;
      if (ri > 2 * pi) ri -= 2 * pi;
      q[++top] = pair<double, int>(le, -a[i].c);
      q[++top] = pair<double, int>(ri, a[i].c);
      if (le > ri + eps) {
        q[++top] = pair<double, int>(0, -a[i].c);
        q[++top] = pair<double, int>(2 * pi, a[i].c);
      }
    }
  sort(q + 1, q + top + 1);
  static int S[3];
  S[1] = S[2] = 0;
  for (int i = (int)(1); i <= (int)(top); i++) {
    S[abs(q[i].second)] += (q[i].second < 0 ? 1 : -1);
    if (S[1] && !S[2]) return 1;
  }
  return 0;
}
int main() {
  scanf("%d%d", &n, &m);
  int lx = 10000, ly = 10000, rx = 0, ry = 0;
  for (int i = (int)(1); i <= (int)(n + m); i++) {
    scanf("%d%d", &a[i].x, &a[i].y);
    a[i].c = (i <= n ? 1 : 2);
    lx = min(lx, a[i].x);
    rx = max(rx, a[i].x);
    ly = min(ly, a[i].y);
    ry = max(ry, a[i].y);
  }
  double mx = sqr(rx - lx) + sqr(ry - ly);
  double ans = 0;
  for (int i = (int)(1); i <= (int)(n + m); i++)
    if (check(i, mx)) return puts("-1"), 0;
  for (int i = (int)(1); i <= (int)(n + m); i++) {
    if (!check(i, ans)) continue;
    double l = ans, r = mx;
    for (int T = (int)(1); T <= (int)(100); T++) {
      double mid = (l + r) / 2;
      if (check(i, mid))
        l = ans = mid;
      else
        r = mid;
    }
  }
  printf("%.18lf\n", ans);
}
