Given a sequence of Cartesian coordinates (x,y) representing cities on a map, compute the maximum inter-city distance over all pairs of cities.
Given a sequence of integers, compute the largest possible number that divides all the integers in the sequence. For example, if the sequence is 12 24 6, then the output should be 6 because 6 divides itself, 24, and 12.
Solution
a) let us consider three points are given labeled as (x1,y1) (x2,y2) (x3,y3)
Now to compute the maximum inter-city distance follow the below steps:
b) If we are given with a sequence of numbers, then we will find Greatest Common Factor(g.c.d) for every pair and the final value will be the answer
.