Farthest Pair of Points


Submit solution

Points: 100
Time limit: 2.0s
Memory limit: 256M

Author:
Problem types

Find a pair of input points having maximum Euclidean distance.

Input

The first line contains \(n\). Each of the next \(n\) lines contains coordinates \(x,y\).

The input satisfies:

  • \(2 <= n <= 10\)

Output

First print Nhap so diem n:, followed on the same line by Nhap thong tin diem thu i (x y): for every \(i\) from 1 through \(n\), then Hai diem co khoang cach lon nhat:. On the next two lines print the selected points as (x, y) in input order. On the final line print Khoang cach: d, where \(d\) has at most six significant digits and no unnecessary trailing zeros. Ties use the earliest pair.

Example

Input
3
1 2
3 4
5 6
Output
Nhap so diem n: Nhap thong tin diem thu 1 (x y): Nhap thong tin diem thu 2 (x y): Nhap thong tin diem thu 3 (x y): Hai diem co khoang cach lon nhat:
(1, 2)
(5, 6)
Khoang cach: 5.65685

Comments

There are no comments at the moment.