想計算幾何,但是事快排題目
#include <stdio.h>
#include <stdlib.h>

const int LEN = 10005;

struct


{
int x;
int y;
}p[LEN];

struct


{
double x;
double y;
}mid;

int cmp ( const void *a, const void *b )


{

int ans = *( int * )a - *( int * )b;

if ( ! ans )

{
ans = *( ( int * )b + 1 ) - *( ( int * )a + 1 );
}

return ans;
}

int main ()


{

int c;
int n;

scanf ( "%d", &c );
while ( c -- )

{
scanf ( "%d", &n );
for ( int i=0; i<n; i++ )

{
scanf ( "%d%d", &p[i].x, &p[i].y );
}

qsort ( p, n, sizeof ( p[0] ), cmp );

if ( n == 1 || n == 2 )

{
printf ( "yes\n" );
}
else

{
if ( n & 1 )

{
mid.x = (double)p[n/2].x;
mid.y = (double)p[n/2].y;

for ( i=0; i<n/2; i++ )

{
double x = (double)p[i].x + (double)p[n-i-1].x;
double y = (double)p[i].y + (double)p[n-i-1].y;
if ( x / 2 != mid.x || y / 2 != mid.y )

{
break;
}
}
if ( i < n / 2 )

{
printf ( "no\n" );
}
else

{
printf ( "yes\n" );
}
}
else

{
mid.x = ( (double)p[n/2].x + (double)p[n/2-1].x ) / 2;
mid.y = ( (double)p[n/2].y + (double)p[n/2-1].y ) / 2;

for ( i=0; i<n/2; i++ )

{
double x = (double)p[i].x + (double)p[n-i-1].x;
double y = (double)p[i].y + (double)p[n-i-1].y;
if ( x / 2 != mid.x || y / 2 != mid.y )

{
break;
}
}
if ( i < n / 2 )

{
printf ( "no\n" );
}
else

{
printf ( "yes\n" );
}
}
}
}
return 0;
}













































































































































