/******************
 最も離れた席を捜す
******************/
#include <stdio.h>
#include <math.h>

#define MAX_SEAT 10    /*空席の数の指定*/

void main(void)
{
    int    seat_no[MAX_SEAT];    /*空席の番号*/
    float  point[MAX_SEAT][2];   /*空席の座標*/

    float  x_distance;                /*x座標の距離*/
    float  y_distance;                /*y座標の距離*/
    float  distance;                  /*２点間の距離*/
    float  max_distance = 0.0;        /*最も離れた距離*/
    int    most_far_seats[2];      /*最も離れた距離の２つの点*/
    int    i;
    int    j;

    /*すべての空席について空席の番号と座標を入力する。*/
    for(i=0; i<MAX_SEAT; i++)
        scanf("%d %f %f", &seat_no[i], &point[i][0], &point[i][1]);

    /*すべての空席について以下の処理を繰り返す。*/
    for(i=0; i<MAX_SEAT-1; i++)

        /*２点間の距離をはかってない座席について以下の処理を繰り返す。*/
        for(j=i+1; j<MAX_SEAT; j++){

            /*２点間の距離を計算する。*/
            x_distance = point[1][0] - point[j][0];
            y_distance = point[i][1] - point[j][1];
            distance   = sqrt(x_distance*x_distance + y_distance*y_distance);

            /*これまでの２つの席の距離の最大値より計算結果が大きければ以下の処理を繰り返す*/
            if( max_distance < distance ){

                /*計算結果を最大値とする*/
                max_distance = distance;
                /*いま計算した席の番号を最も離れた席とする*/
                most_far_seats[0] = seat_no[i];
                most_far_seats[1] = seat_no[j];
            }
        }

    /*最も離れた座席と距離を表示する。*/
    printf("最も離れた座席は");
    printf("%d と %d です (距離 %f)\n",most_far_seats[0], most_far_seats[1], max_distance);
}
