CF618C.Constellation
普及/提高-
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Cat Noku has obtained a map of the night sky. On this map, he found a constellation with n stars numbered from 1 to n. For each i, the i-th star is located at coordinates (x__i, y__i). No two stars are located at the same position.
In the evening Noku is going to take a look at the night sky. He would like to find three distinct stars and form a triangle. The triangle must have positive area. In addition, all other stars must lie strictly outside of this triangle. He is having trouble finding the answer and would like your help. Your job is to find the indices of three stars that would form a triangle that satisfies all the conditions.
It is guaranteed that there is no line such that all stars lie on that line. It can be proven that if the previous condition is satisfied, there exists a solution to this problem.
猫诺库获得了一张夜空地图。在这张地图上,他发现了一个由 n 颗恒星组成的星座,编号从 1 到 n。对每个 i,第 i 颗恒星位于坐标 (xi,yi) 处。任意两颗恒星的位置均不相同。
傍晚时分,诺库将仰望夜空。他希望选出三颗互不相同的恒星,构成一个面积为正的三角形。此外,其余所有恒星都必须严格位于该三角形外部。他难以找到满足条件的答案,因此请求你的帮助。你的任务是找出构成满足上述所有条件的三角形的三颗恒星的编号(下标)。
题目保证:不存在一条直线,使得所有恒星均位于该直线上。可以证明,在满足前述条件的前提下,本题一定存在解。
输入格式
The first line of the input contains a single integer n (3 ≤ n ≤ 100 000).
Each of the next n lines contains two integers x__i and y__i ( - 109 ≤ x__i, y__i ≤ 109).
It is guaranteed that no two stars lie at the same point, and there does not exist a line such that all stars lie on that line.
输入的第一行包含一个整数 n(3≤n≤100000)。
接下来的 n 行,每行包含两个整数 xi 和 yi(−109≤xi,yi≤109)。
保证任意两颗星不位于同一点,且不存在一条直线使得所有星星都位于该直线上。
输出格式
Print three distinct integers on a single line — the indices of the three points that form a triangle that satisfies the conditions stated in the problem.
If there are multiple possible answers, you may print any of them.
在一行中输出三个互不相同的整数——即构成满足本题所述条件的三角形的三个点的索引。
若存在多个可能的答案,你可以输出其中任意一个。
输入输出样例
输入#1
3 0 1 1 0 1 1
输出#1
1 2 3
输入#2
5 0 0 0 2 2 0 2 2 1 1
输出#2
1 3 5
说明/提示
In the first sample, we can print the three indices in any order.
In the second sample, we have the following picture.

Note that the triangle formed by starts 1, 4 and 3 doesn't satisfy the conditions stated in the problem, as point 5 is not strictly outside of this triangle (it lies on it's border).
在第一个样例中,我们可以以任意顺序输出这三个下标。
在第二个样例中,我们有如下图所示的情形。

注意:由点 1、4 和 3 构成的三角形不满足题目中所述的条件,因为点 5 并非严格位于该三角形外部(它恰好位于该三角形的边界上)。
输入解题思路,AI测评打分。不知道怎么写?