Sprinklers

Place two fixed sprinklers and choose radii so every flower is covered, minimizing the sum of squared radii; print that minimum as an integer.

Medium5SortingGreedyGeometryBrute forceInterviewNo attempts yetTime limit2sMemory limit512 MB

Problem

Youngsun grows flowers in her yard. She wants them to grow as naturally as possible, so she planted them here and there like weeds. She scattered them so widely that watering them became hard.

So Youngsun bought 2 sprinklers and installed them. The first sprinkler waters a circular area of radius r1r_1, and the second waters a circular area of radius r2r_2. Youngsun wants to adjust the two radii so that every flower gets water. A flower only needs water from at least one of the two sprinklers.

A flower at (p,q)(p, q) gets water from a sprinkler at (s,t)(s, t) with radius rr exactly when (ps)2+(qt)2r\sqrt{(p-s)^2+(q-t)^2} \le r.

The watered area is (r12+r22)π(r_1^2+r_2^2)\pi, and Youngsun wants to make this value as small as possible to save water. For simplicity, ignore π\pi. Find the minimum value of r12+r22r_1^2+r_2^2 such that every flower gets water.

Input

The first line contains the number of flowers nn and the sprinkler coordinates x1x_1, y1y_1, x2x_2, y2y_2. The first sprinkler is at (x1,y1)(x_1, y_1) and the second is at (x2,y2)(x_2, y_2). (1n20001 \le n \le 2000, 106x1,y1,x2,y2106-10^6 \le x_1, y_1, x_2, y_2 \le 10^6)

Each of the next nn lines contains the coordinates xx, yy of one flower. (106x,y106-10^6 \le x, y \le 10^6)

All flower and sprinkler coordinates are pairwise distinct.

Output

Print the minimum value of r12+r22r_1^2+r_2^2 as an integer. A radius may be 00.