#include <iostream>// 对称轴是横坐标平均值
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <set>
#include <algorithm>
using namespace std;
const int maxn = 1000 + 10;
struct Point{
int x, y;
Point(int x = 0, int y = 0) : x(x), y(y) {}
bool operator < (const Point& rhs) const{
return x < rhs.x || (x == rhs.x && y < rhs.y);
}
};
Point p[maxn];
int main()
{
int T, n;
scanf("%d", &T);
while(T--)
{
scanf("%d", &n);
set<Point> sp;
double sum = 0, ave;
for(int i = 0; i < n; i++)
{
scanf("%d%d", &p[i].x, &p[i].y);
sp.insert(p[i]);
sum += p[i].x;
}
ave = sum / n;
bool flag = true;
for(int i = 0; i < n; i++)
{
Point t((int)(ave * 2) - p[i].x, p[i].y);
if(!sp.count(t)) {flag = false; break;}
}
printf("%s\n", flag ? "YES" : "NO");
}
return 0;
}
UVa1595
最新推荐文章于 2021-04-12 19:04:07 发布