当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6882:Divide and Conquer

Special Judge 特殊评判
题目描述
Given $n$ points in 2D plane, where $n \equiv 0 \pmod{4}$, no two points coincide and no three points are collinear. Find two intersecting lines satisfying that no given points lie in the two lines and that for each of the four divided areas, there are exactly $\frac{n}{4}$ given points. If multiple solutions exist, print any one of them. If no solution, print "-1" in one line.
输入解释
The first line contains one positive integer $T$ ($1\le T \le 20$), denoting the number of test cases. For each test case:

The first line contains one integer $n\,(4 \le n \le 50000)$, denoting the number of given points.

Following $n$ lines each contains two integers $x_i, y_i\,(|x_i|, |y_i| \le 10^6)$, denoting one given point $(x_i, y_i)$.

It is guaranteed that $\sum n \le 10^5, \, n \equiv 0 \pmod{4}$, that no two points coincide and that no three points are collinear.
输出解释
For each test case:

If no solution, print "-1" in one line. Else print two lines each containing four integers $x_1, y_1, x_2, y_2 \, ((x_1, y_1) \neq (x_2, y_2))$ with absolute value not exceeding $10^9$, denoting one line passing $(x_1, y_1), (x_2, y_2)$ simultaneously.
输入样例
2
4
-1 -1
-1 1
1 -1
1 1
8
0 0
0 1
2 0
2 1
1 2
1 3
3 2
3 3
输出样例
0 1 0 -1
1 0 -1 0
1 0 2 3
0 2 3 1
来自杭电HDUOJ的附加信息
Recommend IceyWang

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6882

最后修改于 2020-10-25T23:35:13+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
3000/1500MS(Java/Others) 262144/262144K(Java/Others)