'''
Coordonatele a N puncte in planul cartezian sunt
memorate in doi vectori:
A - vectorul absciselor
O - vectorul ordonatelor
Output: Sa se determine in plan segmentul de lungime maxima.
De precizat ca se cere o singura solutie, daca sunt mai multe
segmente de lungime maxima.
Example:
Introduceti numarul de puncte -> 3
Introduceti coordonatele punctelor ->
Abscisa punctului 0 -> 1
Ordonata punctului 0 -> 3
Abscisa punctului 1 -> -1
Ordonata punctului 1 -> 1
Abscisa punctului 2 -> 2
Ordonata punctului 2 -> -4
Max Segment -> 7.07107
Points -> (1, 3) - (2, -4)
'''
import math
def main( ) :
Abs = [ 0 ] * 100
Ord = [ 0 ] * 100
maxA = 0
maxB = 0
dist = 0
N = int ( input ( "Number of points -> " ) )
for i in range ( 0 , N) :
Abs[ i] = int ( input ( f"Abscisa point {i} = " ) )
Ord[ i] = int ( input ( f"Ordonata point {i} = " ) )
for i in range ( 0 , N - 1 ) :
for j in range ( i + 1 , N) :
d = math .sqrt ( ( Abs[ i] - Abs[ j] ) * ( Abs[ i] - Abs[ j] ) + ( Ord[ i] - Ord[ j] ) * ( Ord[ i] - Ord[ j] ) )
if d > dist:
dist = d
maxA = i
maxB = j
print ( f"Largest Segment is { dist } with points: ({Abs[maxA]},{Ord[maxA]}) - ({Abs[maxB]},{Ord[maxB]})" )
main( )
JycnCkNvb3Jkb25hdGVsZSBhIE4gcHVuY3RlIGluIHBsYW51bCBjYXJ0ZXppYW4gc3VudAptZW1vcmF0ZSBpbiBkb2kgdmVjdG9yaToKQSAtIHZlY3RvcnVsIGFic2Npc2Vsb3IKTyAtIHZlY3RvcnVsIG9yZG9uYXRlbG9yCk91dHB1dDogU2Egc2UgZGV0ZXJtaW5lIGluIHBsYW4gc2VnbWVudHVsIGRlIGx1bmdpbWUgbWF4aW1hLgpEZSBwcmVjaXphdCBjYSBzZSBjZXJlIG8gc2luZ3VyYSBzb2x1dGllLCBkYWNhIHN1bnQgbWFpIG11bHRlCnNlZ21lbnRlIGRlIGx1bmdpbWUgbWF4aW1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