#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1e18;
const int inf = 1e9;
#define rep(i, a, b) for (int i = a; i < b; i++)
#define per(i, b, a) for (int i = a - 1; i >= b; i--)
using Graph = vector<vector<int>>;
using pint = pair<int, int>;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
int dxx[8] = {1, 1, 1, 0, 0, -1, -1, -1}, dyy[8] = {-1, 0, 1, -1, 1, -1, 0, 1};

int main() {
    // 解説AC
    int n;
    cin >> n;
    pint red[n], blue[n];
    rep (i, 0, n) cin >> red[i].first >> red[i].second;
    rep (i, 0, n) cin >> blue[i].first >> blue[i].second;
    sort (red, red + n);
    sort (blue, blue + n);
    bool chk[n] = {};
    int ans = 0;
    // まず、redの点を固定する
    per (i, 0, n) {
        int res = -1;
        int now = inf;
        per (j, 0, n) {
            if (chk[j]) continue;
            if (red[i].first < blue[j].first &&
                red[i].second < blue[j].second) {
                // 条件に当てはまる中でblueのyが最も小さいのを選ぶ
                if (now > blue[j].second) {
                    res = j;
                    now = blue[j].second;
                }
            }
        }
        if (res != -1) {
            chk[res] = 1;
            ans++;
        }
    }
    cout << ans << "\n";
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const static ll INF = 1e15;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
// __uint128_t
const ll MOD = 1e9+7;


long double dist(ll x1, ll y1, ll x2, ll y2){
    return sqrt((double)pow(x2-x1, 2) + (double)pow(y2-y1, 2));
}


int main(){
    ll N; cin >> N;
    vector<ll> X(N), Y(N); for(int i = 0; i < N; i++) cin >> X[i] >> Y[i];
    long double ans = 0.0;
    for(int i = 0; i < N-1; i++){
        for(int j = i+1; j < N; j++){
            ans += dist(X[i], Y[i], X[j], Y[j]) * 2.0;
        }
    }
    cout << setprecision(20) << ans / (long double) N << endl;;
} 
