static void Main(string[] args) { int n = KyoproLibrary.ReadInteger(); int[,] points = KyoproLibrary.ReadIntegerPairArray(n); double max_distance = 0; for (int i = 0; i < n - 1; i++) { for (int j = i + 1; j < n; j++) { double distance = DistSqrd(points[i, 0], points[i, 1], points[j, 0], points[j, 1]); if (distance > max_distance) { max_distance = distance; } } } Console.WriteLine(Math.Sqrt(max_distance)); Console.ReadLine(); }
static double DistSqrd(int x, int y, int _x, int _y) { return(KyoproLibrary.FastPower(x - _x, 2) + KyoproLibrary.FastPower(y - _y, 2)); }