Pagini recente » Cod sursa (job #1234396) | Cod sursa (job #2283176) | Cod sursa (job #1645455) | Cod sursa (job #2954774) | Cod sursa (job #1185997)
#include <cstdio>
#include <algorithm>
#define LIM 1000010
using namespace std;
int x[LIM],y[LIM];
int main()
{
freopen("antitir.in","r",stdin);
freopen("antitir.out","w",stdout);
int n,jum,i,*px,*py,pozx,pozy,nrx,nry;
scanf("%d",&n);
for(i=1;i<=n;++i)
scanf("%d%d",x+i,y+i);
jum=n/2;
px=nth_element(x,x+jum,x+n),pozx=(int)(px-x);
py=nth_element(y,y+jum,y+n),pozy=(int)(py-y);
if(n%2)
nrx=x[pozx],nry=y[pozy];
else
nrx=(x[pozx]+x[pozx+1])/2,nry=(y[pozy]+y[pozy+1])/2;
printf("%d %d",nrx,nry);
return 0;
}