744_D. Hongcow Draws a Circle

Hongcow really likes the color red. Hongcow doesn't like the color blue.

Hongcow is standing in an infinite field where there are n red points and m blue points.

Hongcow wants to draw a circle in the field such that this circle contains at least one red point, and no blue points. Points that line exactly on the boundary of the circle can be counted as either inside or outside.

Compute the radius of the largest circle that satisfies this condition. If this circle can have arbitrarily large size, print  - 1. Otherwise, your answer will be accepted if it has relative or absolute error at most 10 - 4.

Input

The first line of the input will contain two integers n, m (1 ≤ n, m ≤ 1, 000).

The next n lines will contain two integers xi, yi (1 ≤ xi, yi ≤ 104). This denotes the coordinates of a red point.

The next m lines will contain two integers xi, yi (1 ≤ xi, yi ≤ 104). This denotes the coordinates of a blue point.

No two points will have the same coordinates.

Output

Print  - 1 if the circle can have arbitrary size. Otherwise, print a floating point number representing the largest radius circle that satisfies the conditions. Your answer will be considered correct if its absolute or relative error does not exceed 10 - 4.

Namely, let's assume that your answer is a and the answer of the jury is b. The checker program will consider your answer correct if <image>.

Examples

Input

2 5
2 3
3 4
1 1
1 4
4 2
4 7
2 5


Output

3.5355338827


Input

1 6
3 3
1 5
5 4
2 1
3 4
4 2
1 3


Output

1.5811388195


Input

2 2
2 2
3 3
1 1
4 4


Output

-1

Note

This is a picture of the first sample 

<image>

This is a picture of the second sample 

<image>

Example input:
2 5
2 3
3 4
1 1
1 4
4 2
4 7
2 5

2 2
2 2
3 3
1 1
4 4

1 6
3 3
1 5
5 4
2 1
3 4
4 2
1 3


Example output:
3.535533905934155

-1

1.581138830084897


Tags: geometry
Difficulty rating: 3200

Solution:
#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
const int mod = 998244353;
const int inf = 1 << 20;
const double dinf = 1e12;
const double eps = 1e-7;
const double pi = acos(-1.0);
int n, m;
vector<pair<double, int> > iss;
struct node {
  double x, y;
} p[maxn];
double dis(node &a, node &b) {
  return sqrt(((a.x - b.x) * (a.x - b.x)) + ((a.y - b.y) * (a.y - b.y)));
}
bool judge(int o, double r) {
  iss.clear();
  if (o <= n)
    iss.push_back(pair<double, int>(-pi, 1)),
        iss.push_back(pair<double, int>(pi, -1));
  for (int i = 1; i <= (n + m); i++)
    if (i != o) {
      double d = dis(p[o], p[i]);
      if (d > 2 * r) continue;
      double arc = atan2(p[i].y - p[o].y, p[i].x - p[o].x);
      double shift = acos(d / 2 / r);
      double arc1 = arc - shift;
      double arc2 = arc + shift;
      if (arc1 <= -pi) arc1 += pi * 2;
      if (arc2 > pi) arc2 -= pi * 2;
      if (arc1 <= arc2)
        iss.push_back(pair<double, int>(arc1, i <= n ? 1 : -inf)),
            iss.push_back(pair<double, int>(arc2, i <= n ? -1 : inf));
      else
        iss.push_back(pair<double, int>(-pi, i <= n ? 1 : -inf)),
            iss.push_back(pair<double, int>(arc2, i <= n ? -1 : inf)),
            iss.push_back(pair<double, int>(arc1, i <= n ? 1 : -inf)),
            iss.push_back(pair<double, int>(pi, i <= n ? -1 : inf));
    }
  sort(iss.begin(), iss.end());
  int cnt = 0;
  for (auto i : iss) {
    cnt += i.second;
    if (cnt > 0) return true;
  }
  return false;
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= (n + m); i++) scanf("%lf %lf", &p[i].x, &p[i].y);
  double ans = 0;
  for (int i = 1; i <= n + m; i++)
    if (judge(i, ans)) {
      if (judge(i, dinf)) {
        printf("-1");
        return 0;
      }
      double lb = ans, rb = dinf;
      while (rb - lb > eps) {
        double mid = (lb + rb) / 2.0;
        judge(i, mid) ? lb = mid : rb = mid;
      }
      ans = lb;
    }
  printf("%lf", ans);
  return 0;
}