Function calculates distance between two points
long dist ( pair < long , long > p1 , pair < long , long > p2 ) { long x0 = p1 . first - p2 . first ; long y0 = p1 . second - p2 . second ; return x0 * x0 + y0 * y0 ; }