#include <bits/stdc++.h>
using namespace std;
int x[100005], y[100005];
int up[2000005], down[2000005];
int A = 1000000;
bool on(int i, int j, int nx, int ny) {
  return 1LL * (x[j] - x[i]) * (ny - y[i]) -
             1LL * (y[j] - y[i]) * (nx - x[i]) ==
         0;
}
bool cw(int i, int j, int nx, int ny) {
  return 1LL * (x[j] - x[i]) * (ny - y[i]) -
             1LL * (y[j] - y[i]) * (nx - x[i]) >=
         0;
}
bool ccw(int i, int j, int nx, int ny) {
  return 1LL * (x[j] - x[i]) * (ny - y[i]) -
             1LL * (y[j] - y[i]) * (nx - x[i]) <=
         0;
}
double solveX(int n) {
  for (int i = -A; i <= A; ++i) {
    up[i + A] = -2 * A;
    down[i + A] = 2 * A;
  }
  bool ok1 = false, ok2 = false;
  for (int i = 2; i < n; ++i)
    if (!on(i - 2, i - 1, x[i], y[i])) {
      ok1 = cw(i - 2, i - 1, x[i], y[i]);
      ok2 = ccw(i - 2, i - 1, x[i], y[i]);
      break;
    }
  for (int i = 0; i < n; ++i) {
    int lx = min(x[i], x[i + 1]), rx = max(x[i], x[i + 1]);
    if (lx == rx) {
      up[lx + A] = max(up[lx + A], max(y[i], y[i + 1]));
      down[lx + A] = min(down[lx + A], min(y[i], y[i + 1]));
    } else
      for (int j = lx; j <= rx; ++j) {
        long double ny =
            (1.0 * (y[i + 1] - y[i]) * (j - x[i]) / (x[i + 1] - x[i]));
        int u = ny + y[i] - 2;
        if (ok1) {
          if (!cw(i, i + 1, j, u)) {
            ++u;
            while (!cw(i, i + 1, j, u)) {
              ++u;
            }
            down[j + A] = u;
          } else {
            while (cw(i, i + 1, j, u + 1)) ++u;
            up[j + A] = u;
          }
        }
        if (ok2) {
          if (!ccw(i, i + 1, j, u)) {
            ++u;
            while (!ccw(i, i + 1, j, u)) {
              ++u;
            }
            down[j + A] = u;
          } else {
            while (ccw(i, i + 1, j, u + 1)) ++u;
            up[j + A] = u;
          }
        }
      }
  }
  long double ret = 0;
  long long sum = 0, total = 0;
  for (int i = -A; i <= A; ++i) {
    if (up[i + A] >= down[i + A]) {
      total += (up[i + A] - down[i + A] + 1);
      ret += 1LL * i * i * (up[i + A] - down[i + A] + 1);
      sum += 1LL * i * (up[i + A] - down[i + A] + 1);
    }
  }
  for (int i = -A; i <= A; ++i) {
    if (up[i + A] >= down[i + A]) {
      ret -= 1.0 * i * (up[i + A] - down[i + A] + 1) / total * sum;
    }
  }
  return ret / (total - 1);
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d%d", &x[i], &y[i]);
  x[n] = x[0];
  y[n] = y[0];
  double ans = solveX(n);
  for (int i = 0; i <= n; ++i) swap(x[i], y[i]);
  memset(up, 0, sizeof(up));
  memset(down, 0, sizeof(down));
  ans += solveX(n);
  printf("%.7lf\n", ans);
  return 0;
}
