#include <iostream>
#include <cmath>
using namespace std;
int main()
{
setlocale(LC_ALL, "ru");
int n;
cout << "Введите количество точек" << endl;
cin >> n;
int *x = new int[n];
int *y = new int[n];
double max = 0, a, c, s = 0;
cout << "Введите точки" << endl;
for (int i = 0; i < n; i++)
{
cin >> x[i] >> y[i];
}
cout << "Вывод массивов на экран" << endl;
cout << "X: ";
for (int i = 0; i < n; i++)
{
cout << x[i] << " ";
}
cout << endl;
cout << "Y: ";
for (int i = 0; i < n; i++)
{
cout << y[i] << " ";
}
for (int i = 0; i < n; i++)
{
for (int j = i; j < n; j++)
{
s += sqrt((x[i] - x[j])*(x[i] - x[j]) + (y[i] - y[j])*(y[i] - y[j]));
if (s > max)
{
max = s;
a = i;
c = j;
}
}
}
cout << endl << "Самые удаленные точки друг от друга " << a << " " << c << endl;
delete[] x;
delete[] y;
return 0;
}