var GET = (function () {function f(s) {return new g(s);}function g(s) {this._s = s.trim().split("\n");}g.prototype.getValue = function (n) {return this._s[n];};g.prototype.getArray = function (n) {return this.stoa(this._s[n]);};g.prototype.slice = function (s, limit) {return this._s.slice(s, +limit + s || undefined).map(v => this.stox(v));};g.prototype.sliceArray = function (s, limit) {return this._s.slice(s, +limit + s || undefined).map(v => this.stoa(v));};g.prototype.stoa = function (s) {return s.split(" ").map(v => this.stox(v));};g.prototype.stox = function (v) {var i = +v;return (i === i) ? i : v;};return f;})();
var o = GET(require("fs").readFileSync("/dev/stdin", "utf8"));

const permutation = ({ result = [], pre = [], post, n = post.length }) => {
    if (n > 0) {
        post.forEach((_, i) => {
            const rest = [...post];
            const elem = rest.splice(i, 1);
            permutation({ result, pre: [...pre, ...elem], post: rest, n: n - 1});
        });
    } else {
        result.push(pre);
    }
    return result;
};


console.log(main());
function main(){
    var N = o.getValue(0);
    var locations = o.sliceArray(1);

    var i = 0;

    var result = permutation({post: locations});

    var sum = 0;
    for(var i = 0; result.length > i; i++) {
        var record = result[i];
        for(var j = 0; record.length > j + 1; j++) {
            sum += Math.sqrt(Math.pow(record[j][0] - record[j + 1][0], 2) + Math.pow(record[j][1] - record[j + 1][1], 2));
        }
    }

    return sum / result.length
}
