King and his Quest
All submissions for this problem are available.
Once there was a king who wanted to conquer the largest continent on Earth. During his time Earth was thought to be a plane with only integer coordinates. But, he didn't have a map. He knew that the countries are like points located at (int X, int Y); The continents had the following properties:
Given the set of all countries on the earth, the king wants you to help him find the radius of the largest continent.
Note: A continent may contain only a single country.
The first line contains an integer T denoting the number of test cases.
For each test case, the first line contains an integer N denoting the number of countries and the successive N lines contains X and Y values for each of the N countries.
For each test case, you have to print a single line containing the radius R of the largest continent.
- 1 ≤ T ≤ 10
- -100000 ≤ X,Y ≤ 100000
Input: 2 19 -1 1 0 1 0 2 0 0 1 1 1 2 1 3 1 0 1 -1 2 1 2 2 2 0 3 1 -5 -9 -11 -8 -10 -8 -10 -7 -10 -9 -9 -8 4 1 0 -1 0 0 -1 0 1 Output: 2 0
The first test case represent 3 continents of radii 0, 1 and 2 and the second test case represent 4 continents each of radius 0. So, the output i.e, the radius of the largest continent is 2 and 0 for first and second test case respectively.
|Time Limit:||2 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, PYP3, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.