- 6013번
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <string>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
int X_i[n];
int Y_i[n];
int dis = 0;
vector<int> disArr;
for(int i = 0; i < n; i++) {
cin >> X_i[i] >> Y_i[i];
}
for(int i = 0; i < n; i++) {
for(int j = i+1; j < n; j++) {
dis += sqrt(pow((X_i[i] + X_i[j]),2) + pow((Y_i[i] + Y_i[j]), 2));
disArr.push_back(dis);
}
}
int max = *max_element(disArr.begin(), disArr.end());
cout << max << endl;
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
int tempDis = sqrt(pow((X_i[i] - X_i[j]), 2) + pow((Y_i[i] - Y_i[j]), 2));
if (max == tempDis) {
cout << i << " " << j << endl;
}
}
}
}