Problem: The Minister for education is coming! Naturally, nobody wants to perform poorly in front of such a honored guest. However, two hours before the arrival it turned out that one of the classes has a malfunctioning lightbulb — for some reason it doesn't get enough energy. The solution was found quickly: all we've got to do is to change the location of the lightbulb so that it got the maximum amount of energy.

Everybody knows that the power of the lightbulb equals <image>, where C is some constant value and ri is the Euclidean distance from the bulb to the i-th generator. Consequently, our task is to minimize <image>. Of course, we know the positions of all generators.

The bulb should be on the ceiling of the class. The ceiling of the class is in the form of a strictly convex m-gon (the class itself has the form of a right prism with a strictly convex m-gon at the bottom). Help to find the optimum location for the bulb. Assume that all generators are in the plane of the class ceiling. Consider that the plane of the class ceiling has some Cartesian coordinate system introduced.

Input

The first line contains integer n (2 ≤ n ≤ 105) — the number of generators. Each of the next n lines contains a pair of integers xi, yi, representing the coordinates of the i-th generator in the plane of the class ceiling. It's guaranteed that no two generators have the same location.

The next line contains integer m (3 ≤ m ≤ 105) — the number of vertexes in the convex polygon that describes the ceiling of the class. Each of the following m lines contains a pair of integers pi, qi, representing the coordinates of the i-th point of the polygon in the clockwise order. It's guaranteed that the polygon is strictly convex.

The absolute value of all the coordinates don't exceed 106.

Output

Print a single real number — the minimum value of the sum of squares of distances from the generators to the point of the lightbulb's optimal position. The answer will be considered valid if its absolute or relative error doesn't exceed 10 - 4.

Examples

Input

4
3 2
3 4
5 4
5 2
4
3 3
4 4
5 3
4 2


Output

8.00000000

Note

We'll define a strictly convex polygon as a convex polygon with the following property: no three vertices of the polygon lie on the same line.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
double xa, xb, xc;
double ya, yb, yc;
int main() {
  cin.tie(0);
  cin.sync_with_stdio(0);
  long long n;
  cin >> n;
  while (n--) {
    double x, y;
    cin >> x >> y;
    xa++;
    ya++;
    xb -= 2 * x;
    yb -= 2 * y;
    xc += x * x;
    yc += y * y;
  }
  long long m;
  cin >> m;
  double ans = 1e100;
  vector<pair<double, double>> pts;
  while (m--) {
    double x, y;
    cin >> x >> y;
    ans = min(ans, (xa * x * x + xb * x + xc) + (ya * y * y + yb * y + yc));
    pts.push_back({x, y});
  }
  bool inside = true;
  double x0 = -xb / (2 * xa), y0 = -yb / (2 * ya);
  for (int a = 0; a < (int)pts.size(); a++) {
    int b = (a + 1) % pts.size();
    double x1 = pts[a].first, y1 = pts[a].second;
    double x2 = pts[b].first, y2 = pts[b].second;
    inside &= (x0 - x1) * (y2 - y1) - (y0 - y1) * (x2 - x1) >= 0;
    double x12 = x1 - x2, x20 = x2 - x0;
    double y12 = y1 - y2, y20 = y2 - y0;
    double alpha = -(x12 * x20 + y12 * y20) / (x12 * x12 + y12 * y12);
    double x = alpha * x1 + (1 - alpha) * x2;
    double y = alpha * y1 + (1 - alpha) * y2;
    if (min(x1, x2) <= x && x <= max(x1, x2) && min(y1, y2) <= y &&
        y <= max(y1, y2)) {
      ans = min(ans, (xa * x * x + xb * x + xc) + (ya * y * y + yb * y + yc));
    }
  }
  if (inside) {
    ans =
        min(ans, (xa * x0 * x0 + xb * x0 + xc) + (ya * y0 * y0 + yb * y0 + yc));
  }
  cout << fixed << setprecision(10) << ans;
}