We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • HackerRank Home

    HackerRank

  • |
  • Prepare
  • Certify
  • Compete
  • Hiring developers?
  1. Prepare
  2. Mathematics
  3. Fundamentals
  4. Most Distant

Most Distant

Problem
Submissions
Leaderboard
Discussions
Editorial

Keko has dots in a 2-D coordinate plane. He wants to measure the gap between the most distant two dots. To make the problem easier, Keko decided to change each dot's or coordinate to zero.

Help Keko calculate the distance!

Input Format

The first line contains an integer, , the number of dots.
The next lines each contain the integer coordinates of the dots in fashion.

Constraints

It is guaranteed that all dots are distinct, and either their or coordinate is equal to .

Output Format

Print the distance between the most distant dots with an absolute error of, at most, .

Sample Input

4
-1 0
1 0
0 1
0 -1

Sample Output

2.000000

Explanation

In the sample, the most distant dots are located at and .
The distance between them is .

Author

enesoncu

Difficulty

Easy

Max Score

30

Submitted By

5960

Need Help?


View discussions
View editorial
View top submissions

rate this challenge

MORE DETAILS

Download problem statement
Download sample test cases
Suggest Edits
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy