All submissions for this problem are available.
Fenton Crackshell started his career as a bean counter, and later was hired by Scrooge due to his prodigious counting abilities. 'Fenton can count faster than the speed of sound but his judgment is not always sound'. When Scrooge says something about liquid assets, Fenton has the entire money bin dumped into a lake. Later, he advices Scrooge to have the assets frozen.
Scrooge feels that he should be kept away from money for some time but does not want him to be idle. Fenton is very strong in arithmetic (counting) but weak in geometry. So he gives him a large number of points not all in a line and tells him to find a line having only two points on it. Solving this problem might help Scrooge decide on where to open his next gold mines to avoid interference with his rival Flintheart.
Help Fenton accomplish the task and get back to working with arithmetic problems with which he is comfortable.
Number of test cases
For each test case:
A test case first specifies the number of points n. The next n lines specify n points. Each point is specified by x-co-ordinate and y-co-ordinate in format
Output 1 line for each test case. Print 4 numbers, specifying 2 points through which the line passes, as follows
If no such line exists, output
-1 -1 -1 -1
Note: All points have x>=0 & y>=0
Input: 1 5 0 0 1 0 1 1 0.5 1.5 0 1 Output: 0 0 0 1
|Time Limit:||50 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, 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, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.