#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const double INF = 1e20;
const double PI = acos(-1.0);
const int TLimit = 80;
inline int dcmp(double x) { return fabs(x) < eps ? 0 : (x < 0 ? -1 : 1); }
struct Point {
  int x, y;
  Point() {}
  Point(int x, int y) : x(x), y(y) {}
} P[2000 + 10];
int n, m, cntg;
double ang[2000 + 10][2000 + 10], dist[2000 + 10][2000 + 10];
pair<double, int> g[2000 + 10];
inline double Getdist(const Point &a, const Point &b) {
  return sqrt((1.0 * a.x - b.x) * (1.0 * a.x - b.x) +
              (1.0 * a.y - b.y) * (1.0 * a.y - b.y));
}
void read() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n + m; i++) scanf("%d%d", &P[i].x, &P[i].y);
  for (int i = 1; i <= n + m; i++)
    for (int j = 1; j <= n + m; j++) {
      dist[i][j] = Getdist(P[i], P[j]);
      ang[i][j] = atan2(P[j].y - P[i].y, P[j].x - P[i].x);
    }
}
void fix(double &x) {
  if (dcmp(x - PI) > 0) x -= 2 * PI;
  if (dcmp(x + PI) < 0) x += 2 * PI;
}
bool check1(int id, double mid) {
  int cnt = 0;
  double d = mid * 2;
  cntg = 0;
  for (int i = n + 1; i <= n + m; i++) {
    if (dcmp(dist[id][i] - d) >= 0) continue;
    double alph = acos(dist[id][i] / d);
    double l = ang[id][i] - alph, r = ang[id][i] + alph;
    fix(l), fix(r);
    if (dcmp(l - r) > 0) cnt++;
    g[++cntg] = pair<double, int>(l, 1);
    g[++cntg] = pair<double, int>(r, -1);
  }
  if (!cnt) return 1;
  sort(g + 1, g + cntg + 1);
  for (int i = 1; i <= cntg; i++)
    if (!(cnt += g[i].second)) return 1;
  return 0;
}
bool check2(int id, double mid) {
  int cnt[2] = {0, 0};
  double d = mid * 2;
  cntg = 0;
  for (int i = 1; i <= n + m; i++) {
    if (id == i) continue;
    if (dcmp(dist[id][i] - d) >= 0) continue;
    double alph = acos(dist[id][i] / d);
    double l = ang[id][i] - alph, r = ang[id][i] + alph;
    fix(l), fix(r);
    if (dcmp(l - r) > 0) cnt[i <= n ? 0 : 1]++;
    g[++cntg] = pair<double, int>(l, i <= n ? 1 : 2);
    g[++cntg] = pair<double, int>(r, i <= n ? -1 : -2);
  }
  if (cnt[0] && !cnt[1]) return 1;
  sort(g + 1, g + cntg + 1);
  for (int i = 1; i <= cntg; i++) {
    cnt[abs(g[i].second) - 1] += (g[i].second < 0 ? -1 : 1);
    if (cnt[0] && !cnt[1]) return 1;
  }
  return 0;
}
bool check(int id, double mid) {
  if (id <= n)
    return check1(id, mid);
  else
    return check2(id, mid);
}
double Divide_Conquer(double l, double r, int id) {
  double mid;
  int tcnt = 0;
  while ((++tcnt) <= TLimit) {
    mid = (l + r) / 2;
    if (check(id, mid))
      l = mid;
    else
      r = mid;
  }
  return l;
}
void solve() {
  double ans = 0;
  for (int i = 1; i <= n + m; i++) {
    if (!check(i, ans)) continue;
    ans = max(ans, Divide_Conquer(ans, INF, i));
  }
  if (!dcmp(ans - INF))
    printf("-1\n");
  else
    printf("%.10lf\n", ans);
}
int main() {
  read();
  solve();
  return 0;
}
