Fossil in the IceProblem code: TFOSS |
All submissions for this problem are available.
A small group of archaeologists is working in the Antarctic. Their sensors have detected a number of caves in which there are interesting fossils. However, a thick layer of ice blocks the entrance to each cave. The archaeologists possess the equipment needed to burn a tunnel in the layer of ice, but the fuel is extremely expensive. In order to determine the size of each fossil the group has launched a number of probes through small bore-holes.
Each probe which hits a fossil emits a signal consisting of its x and y coordinates. Your task is to determine the smallest possible size of the tunnel, which is equal to the maximum distance between any two probes (so that the fossil won’t be damaged during extraction). The drilling equipment requiers the squared value of this distance.
Given a list of coordinates of points containing probes, find the square of the maximum distance between any two probes.
Input
t [the number of tests <= 20] [empty line] n [the number of active probes <= 100000] x1 y1 [coordinates of the first probe] ... xn xn [integer coordinates from -50000000 to 50000000] [empty line] [input for the next test cases...]
Output
o1 [the square of the maximal distance in the first set] on [output for the next test cases...]
Example
Input: 5 1 2 -3 4 0 0 -2 2 2 2 1 0 6 -4 2 2 2 5 0 0 5 6 1 -1 -1 10 0 0 5 1 9 2 12 3 14 4 15 5 16 7 17 10 18 14 19 19 10 2 -3 -1 2 0 5 -5 -1 -4 2 4 0 1 3 4 3 -3 -4 0 -2 Output: 0 16 101 722 98
| Author: | admin |
| Date Added: | 1-12-2008 |
| Time Limit: | 3 sec |
| Source Limit: | 50000 Bytes |
| Languages: | ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.0.0-8, CPP 4.3.2, CS2, D, ERL, F#, FORT, GO, HASK, ICK, ICON, JAR, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, PAS fpc, PAS gpc, PERL, PHP, PIKE, PRLG, PYTH, PYTH 3.1.2, RUBY, SCALA, SCM guile, SCM qobi, ST, TCL, TEXT, WSPC |
Comments
SUCCESSFUL SUBMISSIONS FOR THIS PROBLEM:
HELP
Program should read from standard input and write to standard output. After you submit a solution you can see your results by clicking on the [My Submissions] tab on the problem page. Below are the possible results:
- Accepted
Your program ran successfully and gave a correct answer. If there is a score for the problem, this will be displayed in parenthesis next to the checkmark. - Time Limit Exceeded
Your program was compiled successfully, but it didn't stop before time limit. Try optimizing your approach. - Wrong Answer
Your program compiled and ran succesfully but the output did not match the expected output. - Runtime Error
Your code compiled and ran but encountered an error. The most common reasons are using too much memory or dividing by zero. For the specific error codes see the help section. - Compilation Error
Your code was unable to compile. When you see this icon, click on it for more information.
If you are still having problems, see a sample solution here.

Fetching successful submissions
