题意:找出一条直线,要求将所有点平分到两个平面内且直线不能过其中一个点
题解:按照x和y从小到大排序,如果左边中间那个店的正好在最上面,那直接切一下他右边就可以了
如果左边中间那个点上面还有点。。。就得算一下中间轴然后左右偏一下就可以。。。其实也不难
傻逼写了好几个小时的极角排序
#include <bits/stdc++.h>
using namespace std;
#define maxn int(5e5+5)
const double eps = 1e-6;
const double INF = 1e9;
const double pi = acos (-1.0);
typedef long long int ll;
struct node {
int x,y;
};
node a[maxn];
bool cmp(node a,node b){
if(a.x!=b.x)
return a.x<b.x;
else return a.y<b.y;
}
int main(){
int t;
scanf("%d",&t);
while(t--){
int n;
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%d%d",&a[i].x,&a[i].y);
}
sort(a,a+n,cmp);
if(a[n/2-1].x!=a[n/2].x){
printf("%d %d %d %d\n",a[n/2-1].x,999000000,a[n/2-1].x+1,-999000000);
}else {
printf("%d %d %d %d\n",a[n/2-1].x-1,999000000,a[n/2-1].x+1,int((0.5+a[n/2-1].y)*2.0-999000000));
}
}
}