#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1E9;
pair<double, double> operator+(pair<double, double> &a,
                               pair<double, double> &b) {
  return pair<double, double>(a.first + b.first, a.second + b.second);
}
pair<double, double> operator-(pair<double, double> &a,
                               pair<double, double> &b) {
  return pair<double, double>(a.first - b.first, a.second - b.second);
}
pair<double, double> operator*(pair<double, double> &a, double k) {
  return pair<double, double>(a.first * k, a.second * k);
}
pair<double, double> operator/(pair<double, double> &a, double k) {
  return pair<double, double>(a.first / k, a.second / k);
}
double len(pair<double, double> &x) {
  return sqrt(x.first * x.first + x.second * x.second);
}
double dist(pair<double, double> p, pair<double, double> q) {
  pair<double, double> t = p - q;
  return len(t);
}
pair<double, double> normalize(pair<double, double> x) { return x / len(x); }
const double PI = acos(-1.);
int N, M, x[2005], y[2005];
double lenij[2005][2005];
pair<double, double> perps[2005][2005];
bool feasible(int i, double R) {
  pair<double, double> ci = pair<double, double>(x[i], y[i]);
  vector<pair<double, int> > es;
  for (int j = (0); j < (N + M); j++) {
    if (i == j) continue;
    double d = lenij[i][j];
    if (d >= 2 * R + 1E-9) continue;
    pair<double, double> cj = pair<double, double>(x[j], y[j]);
    d *= .5;
    pair<double, double> cm = ci + cj;
    cm = cm * .5;
    pair<double, double> perp = perps[i][j];
    perp = perp * sqrt(max(0., R * R - d * d));
    pair<double, double> a = cm + perp, b = cm - perp;
    pair<double, double> cia = a - ci, cib = b - ci;
    double aa = atan2(cia.second, cia.first), ab = atan2(cib.second, cib.first);
    if (aa > ab) swap(aa, ab);
    int delta = j < N ? 2 : 1;
    double morePI = j >= N ? 1 : 0;
    if (abs(ab - aa) > PI) {
      es.push_back(make_pair(-PI - morePI, delta));
      es.push_back(make_pair(aa, -delta));
      es.push_back(make_pair(ab, delta));
      es.push_back(make_pair(PI + morePI, -delta));
    } else {
      es.push_back(make_pair(aa, delta));
      es.push_back(make_pair(ab, -delta));
    }
  }
  if (i < N) {
    es.push_back(make_pair(-PI, 2));
    es.push_back(make_pair(PI, -2));
  }
  sort(es.begin(), es.end());
  int suma = 0, sumb = 0;
  for (int k = (0); k < (es.size()); k++) {
    int kf = k, adda = 0, addb = 0, deca = 0, decb = 0;
    while (kf < es.size() && abs(es[kf].first - es[k].first) <= 1e-16) {
      int delta = es[kf++].second;
      if (delta == 2 || delta == -2) {
        if (delta > 0)
          adda++;
        else
          deca++;
      } else {
        if (delta > 0)
          addb++;
        else
          decb++;
      }
    }
    suma += adda;
    sumb -= decb;
    if (suma > 0 && sumb == 0) return true;
    suma -= deca;
    sumb += addb;
    k = kf - 1;
  }
  return false;
}
int main() {
  cin >> N >> M;
  vector<pair<int, int> > pa, pb;
  for (int i = (0); i < (N + M); i++) {
    int xi, yi;
    scanf("%d%d", &xi, &yi);
    if (i < N)
      pa.push_back(pair<int, int>(xi, yi));
    else
      pb.push_back(pair<int, int>(xi, yi));
  }
  random_shuffle(pa.begin(), pa.end());
  random_shuffle(pb.begin(), pb.end());
  for (int i = (0); i < (N + M); i++) {
    if (i < N) {
      x[i] = pa[i].first;
      y[i] = pa[i].second;
    } else {
      x[i] = pb[i - N].first;
      y[i] = pb[i - N].second;
    }
  }
  double minRadius = 1e9;
  for (int i = (0); i < (N + M); i++) {
    pair<double, double> ci = pair<double, double>(x[i], y[i]);
    for (int j = (0); j < (N + M); j++) {
      pair<double, double> cj = pair<double, double>(x[j], y[j]);
      lenij[i][j] = dist(ci, cj);
      pair<double, double> vij = cj - ci;
      vij = normalize(vij);
      perps[i][j] = pair<double, double>(-vij.second, vij.first);
      if ((i < N) ^ (j < N)) minRadius = min(minRadius, lenij[i][j]);
    }
  }
  for (int i = (0); i < (N + M); i++) {
    double l = minRadius, r = 1e9;
    if (r - l <= 1E-9) break;
    if (!feasible(i, minRadius)) continue;
    for (int it = (0); it < (64); it++) {
      double R = (l + r) / 2;
      if (feasible(i, R))
        l = R;
      else
        r = R;
    }
    minRadius = max(minRadius, l);
  }
  if (minRadius >= 1e9 - 1e-6)
    puts("-1");
  else
    printf("%.9f\n", minRadius);
  return 0;
}
