#include <bits/stdc++.h>
using namespace std;
struct ww {
  double x, s, t, sumy, sumyy;
} a[2000010];
int i, j, k, n, m;
int x[2000010], y[2000010];
double l[2000010], r[2000010], s, t, an;
inline void work(int x, int y, int xx, int yy) {
  if (x > xx) swap(x, xx), swap(y, yy);
  if (x == xx) {
    l[x] = min(l[x], 0. + y);
    r[x] = max(r[x], 0. + yy);
    return;
  }
  int i;
  for (i = x; i <= xx; i++) {
    double k = 1. * (yy - y) * (i - x) / (xx - x) + y;
    l[i] = min(l[i], k);
    r[i] = max(r[i], k);
  }
}
inline void Do() {
  int i;
  for (i = 0; i <= 2000010 - 1; i++) r[i] = 0, l[i] = 2000010;
  for (i = 1; i <= n; i++) work(x[i], y[i], x[i + 1], y[i + 1]);
  m = 0;
  for (i = 0; i <= 2000010 - 1; i++)
    if (l[i] < 2000010) {
      int A = int(l[i] - (1e-11)) + 1, B = int(r[i] + (1e-11));
      m++;
      a[m].x = i;
      a[m].s = B - A + 1;
      a[m].t = a[m].x * a[m].s;
    }
  s = t = 0;
  for (i = 1; i <= m; i++) s += a[i].s, t += a[i].t;
  for (i = 1; i <= m; i++)
    an += a[i].t * a[i].x * (s - a[i].s) - (a[i].t * (t - a[i].t));
}
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++)
    scanf("%d%d", &x[i], &y[i]), x[i] += 2000010 / 2, y[i] += 2000010 / 2;
  x[n + 1] = x[1], y[n + 1] = y[1];
  Do();
  for (i = 1; i <= n + 1; i++) swap(x[i], y[i]);
  Do();
  an /= s * (s - 1);
  printf("%.10lf\n", an);
  return 0;
}
