#include <bits/stdc++.h>
using namespace std;
using DO = double;
int n, m;
struct point {
  int first, second;
  point(int first = 0, int second = 0) : first(first), second(second) {}
  point operator+(point a) { return point(first + a.first, second + a.second); }
  point operator-(point a) { return point(first - a.first, second - a.second); }
  point operator*(int a) { return point(first * a, second * a); }
  point operator/(int a) { return point(first / a, second / a); }
  int operator*(point a) { return first * a.first + second * a.second; }
  int operator^(point a) { return first * a.second - second * a.first; }
  DO nor() { return sqrt(*this * *this); }
  point conj() { return point(-second, first); }
  void input() { scanf("%d %d", &first, &second), first *= 2, second *= 2; }
  void print() { printf("%.1lf %.1lf\n", first / 2., second / 2.); }
};
point R[1010], B[1010], X, Y, M, N, dir, P;
using pdd = pair<DO, DO>;
pdd F, II;
void inter(point a, point b, point c, point d) {
  DO s1 = a - c ^ d - c, s2 = d - c ^ b - c, s = s1 + s2;
  s1 /= s, s2 /= s;
  F = {a.first * s2 + b.first * s1, a.second * s2 + b.second * s1};
}
DO ska(DO ax, DO ay, DO bx, DO by) { return ax * bx + ay * by; }
DO ans, d, LL;
void solve(DO len) {
  F = {M.first + II.first * len, M.second + II.second * len};
  ans = max(ans, sqrt((X.first - F.first) * (X.first - F.first) +
                      (X.second - F.second) * (X.second - F.second)));
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) R[i].input();
  for (int i = 0; i < m; i++) B[i].input();
  if (m < 2) puts("-1"), exit(0);
  for (int I = m, J, i, mul; I--;) {
    for (X = B[I], J = I; J--;) {
      DO L = -1e30, R = 1e30, st, ed;
      Y = B[J], M = (X + Y) / 2;
      dir = (Y - M).conj(), N = M + dir;
      LL = dir.nor(), II = {dir.first / LL, dir.second / LL};
      for (i = m; i--;)
        if (i != I && i != J) {
          mul = X - B[i] ^ Y - B[i];
          if (!mul) {
            if ((X - B[i]) * (Y - B[i]) < 0) {
              L = 1e30, R = -1e30;
              break;
            }
            continue;
          }
          P = (X + B[i]) / 2;
          inter(M, N, P, P + (X - P).conj());
          d = ska(F.first - M.first, F.second - M.second, II.first, II.second);
          if (mul > 0)
            R = min(R, d);
          else
            L = max(L, d);
          if (L > R + 1e-8) break;
        }
      if (L > R + 1e-8) continue;
      for (i = n; i--;) {
        mul = X - ::R[i] ^ Y - ::R[i];
        if (!mul) {
          if ((X - ::R[i]) * (Y - ::R[i]) < 0) solve(L), solve(R);
          continue;
        }
        P = (X + ::R[i]) / 2;
        inter(M, N, P, P + (X - P).conj());
        d = ska(F.first - M.first, F.second - M.second, II.first, II.second);
        if (mul > 0)
          st = max(L, d), ed = R;
        else
          st = L, ed = min(R, d);
        if (st < ed + 1e-8) solve(st), solve(ed);
      }
    }
  }
  if (ans > 1e20)
    puts("-1");
  else
    printf("%.10lf\n", ans / 2);
}
