#include
#include
#include
#include
#include
using namespace std; typedef long long ll; const int N=20005; int x[N],y[N]; struct node{ ll v1,v2; bool operator <(const node&p) const{ return v1>p.v1; } } d[N]; int main() { int n; int x1,y1,x2,y2; cin>>n>>x1>>y1>>x2>>y2; int i,j; ll ans=999999999999999999,mx=0; for(i=0;i
>x[i]>>y[i]; d[i].v1=1ll*(x[i]-x1)*(x[i]-x1)+1ll*(y[i]-y1)*(y[i]-y1); d[i].v2=1ll*(x[i]-x2)*(x[i]-x2)+1ll*(y[i]-y2)*(y[i]-y2); mx=max(mx,d[i].v2); } sort(d,d+n); ans=min(d[0].v1,mx); ll s=0,s1=0,s2=0; for(i=n-1;i>=0;i--){ s1=d[i].v1; s2=0; for(j=0;j