Problem: Problem

Given a convex polygon consisting of $ N $ vertices and the center coordinates of $ M $ circles. The radius of all circles is $ r $.

I want to find the minimum real number $ r $ that satisfies the following conditions.

Condition: Every point inside a convex polygon is contained in at least one circle.

Constraints

The input satisfies the following conditions.

* $ 3 \ le N \ le 100 $
* $ 1 \ le M \ le 100 $
* $ -10 ^ 5 \ le px_i, py_i \ le 10 ^ 5 $
* $ -10 ^ 5 \ le cx_i, cy_i \ le 10 ^ 5 $
* No matter which of the three vertices of the convex polygon is selected, they do not exist on the same straight line.

Input

All inputs are given as integers in the following format:


$ N $
$ px_1 $ $ py_1 $
$ px_2 $ $ py_2 $
::
$ px_N $ $ py_N $
$ M $
$ Cx_1 $ $ cy_1 $
$ cx_2 $ $ cy_2 $
::
$ Cx_M $ $ cy_M $


The $ 1 $ line is given an integer $ N $ that represents the number of vertices of the convex polygon.
Information on each vertex of the convex polygon is given in the counterclockwise order from the $ 2 $ line to the $ 2 + N-1 $ line. The $ 1 + i $ line is given $ px_i $ $ py_i $, which represents the coordinates of the $ i $ th vertex, separated by blanks.
The $ 2 + N $ line is given the integer $ M $, which represents the number of circles.
Information on the center coordinates of the circle is given from the $ 2 + N + 1 $ line to the $ 2 + N + M $ line. On the $ 2 + N + i $ line, $ cx_i $ $ cy_i $ representing the center coordinates of the $ i $ th circle is given, separated by blanks.

Output

Outputs the radius $ r $ of the smallest circle that satisfies the condition.
However, absolute or relative errors up to $ 10 ^ {-5} $ are acceptable.

Examples

Input

4
2 3
1 2
2 1
3 2
4
1 3
1 1
3 3
3 1


Output

1.414213562373


Input

7
-96469 25422
-55204 -45592
-29140 -72981
98837 -86795
92303 63297
19059 96012
-67980 70342
17
-4265 -14331
33561 72343
52055 98952
-71189 60872
10459 -7512
-11981 57756
-78228 -28044
37397 -69980
-27527 -51966
22661 -16694
13759 -59976
86539 -47703
17098 31709
-62497 -70998
-57608 59799
-1904 -35574
-73860 121


Output

75307.220122044484

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;

#define EPS (1e-6)
#define EQ(a, b) (abs((a) - (b)) < EPS)

typedef complex<double> vector2;
typedef pair<vector2, vector2> line;

double dot(vector2 a, vector2 b) { return real(conj(a) * b); }
double cross(vector2 a, vector2 b) { return imag(conj(a) * b); }

vector<vector2> cc_cross(vector2 a, vector2 b, double r) {
  double d = abs(b - a);
  double rc = d / 2;
  double rs = sqrt(r * r - rc * rc);
  vector2 diff = (b - a) / d;
  return {a + diff * vector2(rc, rs), a + diff * vector2(rc, -rs)};
}

int main() {
  int n, m;
  cin >> n;
  vector<vector2> p(n);
  for (auto &e : p) {
    double x, y;
    cin >> x >> y;
    e = {x, y};
  }
  cin >> m;
  vector<vector2> c(m);
  for (auto &e : c) {
    double x, y;
    cin >> x >> y;
    e = {x, y};
  }

  double ng = 0, ok = 1e6, r;
  while (ng + EPS < ok) {
    r = (ng + ok) / 2.0;
    bool isok = true;

    vector<int> v(n, -1);
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        if (abs(c[j] - p[i]) < r) {
          v[i] = j;
          break;
        }
      }
      if (v[i] == -1) {
        isok = false;
      }
    }

    if (isok) {
      vector<vector<bool>> g(m, vector<bool>(m));
      for (int i = 0; i < m; i++) {
        for (int j = 0; j < m; j++) {
          if (abs(c[j] - c[i]) < 2 * r) {
            g[i][j] = true;
          }
        }
      }
      for (int k = 0; k < m; k++) {
        for (int i = 0; i < m; i++) {
          for (int j = 0; j < m; j++) {
            if (g[i][k] && g[k][j]) {
              g[i][j] = true;
            }
          }
        }
      }

      for (int i = 0; i < m; i++) {
        isok &= g[0][i];
      }
    }

    if (isok) {
      vector<vector2> u;
      for (int i = 0; i < m; i++) {
        for (int j = i + 1; j < m; j++) {
          vector<vector2> w = cc_cross(c[i], c[j], r);
          for (auto e : w) {
            bool outer = true;
            for (int k = 0; k < m; k++) {
              if (k == i || k == j) {
                continue;
              }
              outer &= abs(e - c[k]) > r;
            }
            if (outer) {
              u.push_back(e);
            }
          }
        }
      }

      for (auto e : u) {
        double t = 0;
        for (int i = 0; i < n; i++) {
          int j = (i + 1) % n;
          vector2 a = p[i] - e, b = p[j] - e;
          t += atan2(cross(a, b), dot(a, b));
        }
        if (!EQ(t, 0)) {
          isok = false;
          break;
        }
      }
    }

    if (isok) {
      ok = r;
    } else {
      ng = r;
    }
  }

  cout << fixed << setprecision(6) << r << endl;
}