#include <iostream>
#include <iomanip>
#include <algorithm>
#include <assert.h>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <map>
#include <unordered_map>
#include <numeric>
#include <functional>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define rrep(i,a) for(ll i=ll(a-1);i>=0;--i)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
inline void Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
template<class itr> void cins(itr first,itr last){
    for (auto i = first;i != last;i++){
        cin >> (*i);
    }
}
template<class itr> void array_output(itr start,itr goal){
    string ans = "",k = " ";
    for (auto i = start;i != goal;i++) ans += to_string(*i)+k;
    if (!ans.empty()) ans.pop_back();
    PRINT(ans);
}
ll gcd(ll a, ll b) {
    return a ? gcd(b%a,a) : b;
}

const ll INF = 1e10;
const ll MOD = 1000000007;
const ll MOD2 = 998244353;
const ll EPS = 1e-10;
int sgn(const double a){
    return (a < -EPS ? -1 : (a > EPS ? +1 : 0));
}
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> tri;
typedef pair<double,double> point;
typedef complex<double> Point;
const ll MAX = 30000;
constexpr ll nx[8] = {1,0,-1,0,1,-1,1,-1};
constexpr ll ny[8] = {0,1,0,-1,1,1,-1,-1};
bool complexSort(Point lhs,Point rhs){
    if (sgn(lhs.real()-rhs.real())){
        return lhs.real() < rhs.real();
    }
    else{
        return lhs.imag() < rhs.imag();
    }
}

double cross(Point z1,Point z2){
    return (conj(z1)*z2).imag();
}
//graham scan
vector<ll> convex_hull(vector<Point> p){
    vector<tuple<double,double,ll>> k;
    rep(i,p.size()){
        k.push_back(make_tuple(p[i].real(),p[i].imag(),i));
    }
    SORT(k);
    vector<ll> index;
    for (auto j:k){
        double a,b;
        ll c;
        tie(a,b,c) = j;
        index.push_back(c);
    }
    //array_output(all(index));
    SORT(k);
    int cnt = 0,n = p.size();
    sort(all(p),complexSort);
    vector<Point> s(n*2);
    vector<ll> ind(n*2);
    rep(i,n){
        while (cnt > 1 && sgn(cross(s[cnt-1]-s[cnt-2],p[i]-s[cnt-1])) <= 0) cnt--;
        s[cnt] = p[i];
        ind[cnt++] = index[i];
    }
    for (ll i = n-2,t = cnt;i >= 0;i--){
        while (cnt > t && sgn(cross(s[cnt-1]-s[cnt-2],p[i]-s[cnt-1])) <= 0) cnt--;
        s[cnt] = p[i];
        ind[cnt++] = index[i];
    }
    ind.resize(cnt-1);
    return ind;
}

class Prim{
    public:
    struct Node{
        vector<pair<double,ll>> edges; // cost node
        bool done;
        double cost;
    };
    ll V;
    vector<Node> nodes;
    Prim(ll v){
        V = v;
        nodes.resize(v);
    }
    void add_edge(ll v,ll node,double cost){
        nodes[v].edges.push_back(make_pair(cost,node));
    }
    double prim(){
        priority_queue<pair<double,ll>,vector<pair<double,ll>>,greater<pair<double,ll>>> mincost;
        rep(i,V){
            nodes[i].cost = INF;
            nodes[i].done = false;
        }
        double res = 0;
        mincost.push(make_pair(0.0,0));
        while(!mincost.empty()){
            pair<double,ll> p = mincost.top();mincost.pop();
            ll v = p.second;
            if (nodes[v].done) continue;
            nodes[v].done = true;
            res += p.first;
            for(pair<double,ll> u:nodes[v].edges){
                if (!nodes[u.second].done) mincost.push(make_pair(u.first,u.second));
            }
        }
        return res;
    }
};
int main(){
    //cin.tie(0);
    //ios::sync_with_stdio(false);
    ll v,r;
    cin >> v >> r;
    vector<Point> place(v);
    rep(i,v){
        double x,y;
        cin >> x >> y;
        place[i] = Point(x,y);
    }
    auto to = convex_hull(place);
    ll siz = to.size();
    //array_output(all(to));
    to.push_back(to[0]);
    Prim g(v);
    double ans = 0.0;
    rep(i,siz){
        ans += abs(place[to[i]]-place[to[i+1]]);
        g.add_edge(to[i],to[i+1],0.0);
        g.add_edge(to[i+1],to[i],0.0);
    }
    rep(i,r){
        ll s,t;
        cin >> s >> t;
        s--;t--;
        g.add_edge(s,t,abs(place[s]-place[t]));
        g.add_edge(t,s,abs(place[s]-place[t]));
    }
    ans += g.prim();
    printf("%.10lf\n",ans);
}



Measured memory_bytes: 3332