HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > "Informatics Stars" Online Contests - 2011-2014 > problem:


2014-04-30. 50560 - Max Distance

"Informatics Stars" Online Contests - 2011-2014

Start: Oct.20.2012 at 10:00:00 AM
Finish: Oct.20.2012 at 03:00:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (1)

Contest problems

• 2012-12-20. 50574 - Triangular Nu...
• 2012-12-30. 50684 - Sum of prime ...
• 2013-01-10. 50584 - Total invoice ...
• 2013-01-30. 50599 - Sum of Squar...
• 2013-03-20. 50578 - Mersenne prime
• 2013-03-30. 50360 - National Elections
• 2013-03-40. 50705 - Student Clubs
• 2014-04-10. 50547 - Close Pair
• 2014-04-30. 50560 - Max Distance
• 2014-04-50. 50569 - 12th Grade Ele...
• 2014-04-50. 50703 - The Shortest Path

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Question by Ibrahim Mesecan.

Max distance

Shqip

Traveling salesman problem is a famous problem. According to the question, the salesman has to travel throgh n islands. And then in the end, he has to return back to his starting island.

Question:
Write a program that gets the x and y coordinates of n islands. Then, the program calculates the max Euclidean distance to travel between two cities according to the given order. The distances between the two consecutive islands are calculated. The last island is connected to the first island.

Input specification
You will be given an integer number (n). Then, in the following n lines, you will be given x and y coordinates of n islands where 1 ≤ n ≤ 40000 and coordinates -5000 ≤ (x and y) ≤ 5000.

Output specification
Show one number with 2 digits double precision, which is the max distance.

 Sample Input  
 4
 1 1
 2 2
 2 4
 1 4
 Sample Output   
 3


Explanation: According to the given order, the distances are:

  • between 1st and 2nd islands is 1.414
  • between 2nd and 3rd islands is 2.0
  • between 3rd and 4th islands is 1.0
  • between 4th and 1st islands is 3.0
And the distance between the 4th and 1st islands is the max distance.

Для отправки решений необходимо выполнить вход.

www.contester.ru