All submissions for this problem are available.
Read problems statements in Mandarin Chinese here
Lira is a little girl form Bytenicut, a small and cozy village located in the country of Byteland.
As the village is located on a somewhat hidden and isolated area, little Lira is a bit lonely and she needs to invent new games that she can play for herself.
However, Lira is also very clever, so, she already invented a new game.
She has many stones with her, which she will display on groups of three stones on the ground on a triangle like shape and then, she will select two triangles, one with the smallest area and one with the largest area as the most beautiful ones.
While it's easy for Lira to "estimate" the areas of the triangles by their relative sizes, it's harder for her to actually calculate these areas.
But, it turns out, that Lira is also friends with YOU, an exceptional Mathematics student, and she knew that you would know exactly how to do such verification.
Lira also numbered the triangles from 1 to N, and now she wants to know the indices of the triangles with the smallest and largest area respectively.
It is now up to you, to help Lira and calculate the areas of the triangles and output their numbers.
The first line of the input file contains an integer, N, denoting the number of triangles on the given input file.
Then N lines follow, each line containing six space-separated integers, denoting the coordinates x1, y1, x2, y2, x3, y3
- 2 ≤ N ≤ 100
- -1000 ≤ xi, yi ≤ 1000
You should output two space separated integers, the indexes of the triangles with the smallest and largest area, respectively.
If there are multiple triangles with the same area, then the last index should be printed.
Input: 2 0 0 0 100 100 0 1 1 1 5 5 1 Output: 2 1
|Tags||cakewalk, geometry, kuruma, oct13|
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.5, 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, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.