#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* template start */ #define rep(i, a, b) for (long long i = (a); (i) < (b); (i)++) #define all(i) i.begin(), i.end() #ifdef LOCAL #define debug(...) std::cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__) #else #define debug(...) #endif void debug_out(){std::cerr< void debug_out(Head h,Tail... t){ std::cerr<<" "<0)std::cout<<" :"; debug_out(t...); } template std::ostream& operator<<(std::ostream& os, std::pair pa) { return os << pa.first << " " << pa.second; } template std::ostream& operator<<(std::ostream& os, std::vector vec) { for (std::size_t i = 0; i < vec.size(); i++)os << vec[i] << (i + 1 == vec.size() ? "" : " "); return os; } template inline bool chmax(T1& a,T2 b){return a inline bool chmin(T1& a,T2 b){return a>b && (a=b,true);} template constexpr Num mypow(Num a, long long b) { if(b==0)return 1; if (a==0)return 0; Num x = 1; while (b > 0) { if(b & 1)x*=a; a*=a; b >>= 1; } return x; } template class modint { using u64 = std::uint_fast64_t; public: u64 a; constexpr modint(const u64 x = 0) noexcept : a(x % Modulus) {} constexpr u64 &value() noexcept { return a; } constexpr const u64 &value() const noexcept { return a; } constexpr bool operator==(const modint rhs) const noexcept {return a==rhs.a;} constexpr bool operator!=(const modint rhs) const noexcept {return !(*this==rhs);} constexpr modint operator+(const modint rhs) const noexcept { return modint(*this) += rhs; } constexpr modint operator-(const modint rhs) const noexcept { return modint(*this) -= rhs; } constexpr modint operator*(const modint rhs) const noexcept { return modint(*this) *= rhs; } constexpr modint operator/(const modint rhs) const noexcept { return modint(*this) /= rhs; } constexpr modint &operator+=(const modint rhs) noexcept { a += rhs.a; if (a >= Modulus) { a -= Modulus; } return *this; } constexpr modint &operator-=(const modint rhs) noexcept { if (a < rhs.a) { a += Modulus; } a -= rhs.a; return *this; } constexpr modint &operator*=(const modint rhs) noexcept { a = a * rhs.a % Modulus; return *this; } constexpr modint &operator/=(modint rhs) noexcept { u64 exp = Modulus - 2; while (exp) { if (exp % 2) { *this *= rhs; } rhs *= rhs; exp /= 2; } return *this; } }; /* template end */ using ll = long long; int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); using Edge=std::pair; ll n,m; std::cin>>n>>m; ll x,y; std::cin>>x>>y; x--;y--; using P=std::pair; std::vector

points(n); for(auto&& e:points)std::cin>>e.first>>e.second; std::vector>> graph(n); rep(i,0,m){ ll p,q; std::cin>>p>>q; p--;q--; long double len=std::hypot(points[p].first-points[q].first,points[p].second-points[q].second); graph[p].emplace_back(q,len); graph[q].emplace_back(p,len); } std::priority_queue,std::greater> que; constexpr long double INF=1e18; std::vector d(n,INF); d[x]=0; que.emplace(0,x); while(!que.empty()){ auto now=que.top();que.pop(); ll v=now.second; if(d[v]d[v]+e.second){ d[e.first]=d[v]+e.second; que.emplace(d[e.first],e.first); } } } std::cout<