// Slower C++ solution:
#include<cstdio>

#include<iostream>

#include<algorithm>

#include<cmath>

#include<cstring>

#include<string>

#include<cstdlib>

#include<ctime>

#include<stack>

#include<queue>

#include<set>

#include<map>

#include<vector>

#define mem(name,value) memset(name,value,sizeof(name))

#define loop(i,from,to) for(int i=from;i<to;i++)

#define loopr(i,from,to) for(int i=from;i>=to;i--)

#define pb push_back

using namespace std;

typedef long long ll;



const int maxn=10000+5;

int par[maxn],r[maxn],x[maxn],y[maxn],V,E;

typedef struct{int u,v; double cost;}edge;

vector<edge> es;



void init(int N)

{

    loop(i,0,N){

        par[i]=i;

        r[i]=0;

    }

}



int Find(int x)

{

    if(par[x]==x) return x;

    else return par[x]=Find(par[x]);

}



void unite(int x,int y)

{

    x=Find(x); y=Find(y);

    if(x==y) return;



    if(r[x]<r[y]) par[x]=y;

    else par[y]=x;

    if(r[x]==r[y]) r[x]++;

}



bool same(int x,int y)

{

    return Find(x)==Find(y);

}



bool cmp(const edge& e1,const edge& e2)

{

    return e1.cost>e2.cost;

}



double kruskal()

{

    sort(es.begin(),es.end(),cmp);

    init(V+1);

    double ans=0;

    loop(i,0,E){

        edge e=es[i];

        if(!same(e.u , e.v)){

            unite(e.u , e.v);

            ans+=e.cost;

        }

    }

    return ans;

}



int main()

{

    double sum=0;

    scanf("%d%d",&V,&E);

    loop(i,1,V+1)

        scanf("%d%d",&x[i],&y[i]);

    loop(i,0,E){

        int f,t;

        double c;

        scanf("%d%d",&f,&t);

        c=sqrt((x[f]-x[t])*(x[f]-x[t])+(y[f]-y[t])*(y[f]-y[t]));

        edge e; e.u=f; e.v=t; e.cost=c; sum+=c;

        es.pb(e);

    }

    printf("%.3f\n",sum-kruskal());

}

// Faster C++ solution for the same problem (measured speedup: 4.6303515212257x):
#include <cstdio>

#include <cstring>

#include <cmath>

#include <algorithm>

using namespace std;



struct node

{

    int x,y,id;

};

struct edge

{

    int u,v;

    double cost;

    edge() {}

    edge(int x,int y,double z)

    {

        u=x;

        v=y;

        cost=z;

    }

    bool operator <(const edge& a) const

    {

        return cost>a.cost;

    }

};



edge es[50010];

int par[10010];

node p[10010];

int n,m;

void init()

{

    for(int i=1;i<=n;i++) par[i]=i;

}



int find(int x)

{

    return x==par[x]?x:par[x]=find(par[x]);

}



void unite(int x,int y)

{

    x=find(x);

    y=find(y);

    if(x!=y) par[x]=y;

}



double dis(int a,int b)

{

    return sqrt(1.0*(p[a].x-p[b].x)*(p[a].x-p[b].x)+1.0*(p[a].y-p[b].y)*(p[a].y-p[b].y));

}



double kruskal()

{

    sort(es,es+m);

    //for(int i=0;i<m;i++) printf("%d %d %lf\n",es[i].u,es[i].v,es[i].cost);

    double s=0;

    for(int i=0;i<m;i++)

    {

        edge e=es[i];

        if(find(e.u)!=find(e.v))

        {

            unite(e.u,e.v);

        }

        else

        {

            s+=e.cost;

        }

    }

    return s;

}

int main()

{

    //freopen("a.txt","r",stdin);

    int a,b;

    double c,sum;

    while(~scanf("%d%d",&n,&m))

    {

        init();

        sum=0;

        for(int i=1;i<=n;i++)

        {

            scanf("%d%d",&p[i].x,&p[i].y);

        }

        for(int i=0;i<m;i++)

        {

            scanf("%d%d",&a,&b);

            c=dis(a,b);

            es[i]=edge(a,b,c);

        }

        printf("%.3lf\n",kruskal());

    }

    return 0;

}