Language: C++

#include <stdio.h>
void quicksort(int a[2][50],int left,int right,int xory);
long long int marea(int a[2][50],int N,int K,int xory);
int main()
{
	int N,K,i,j,a[2][50],xa,xb,xi,xj,ya,yb,yi,yj;
	long long int area,t;
	
	scanf("%d %d",&N,&K);
	for(i=0;i<N;i++) {
		scanf("%d %d",&a[0][i],&a[1][i]);
	}														/*配列に取り込む*/
	area=marea(a[2][50],N,K,0);
	if(area>(t=marea(a[2][50],N,K,1)) area=t;
	printf("%lld\n",area);
	return 0;
}

void quicksort(int a[2][50],int left,int right,int xory)
{
	if(left<right) {
		int i=left,j=right,tmp1,tmp2,nxy,pivot=a[xory][i];
		if(xory==0) {
			nxy=1;
		}else {
			nxy=0;
		}
		while(1) {
		while(a[xory][i]<pivot) i++;
		while(pivot<a[xory][j]) j--;
		if(i>=j)break;
		tmp1=a[xory][i];
		tmp2=a[nxy][i];
		a[xory][i]=a[xory][j];
		a[nxy][i]=a[nxy][j];
		a[xory][j]=tmp1;
		a[nxy][j]=tmp2;
		i++;
		j--;
		}
		quicksort(a,left,i-1,xory);
		quicksort(a,j+1,right,xory);
	}
}

long long int marea(int a[2][50],int N,int K,int xory)
{
	quicksort(a,0,N-1,xory);
	
	for(i=1,xa=a[0][0],xi=a[0][0],ya=a[1][0],yi=a[1][0],xb=xa,xj=xi,yb=ya,yj=yi;i<K;i++) {
		if(a[0][i]>xa) {
			xb=xa;
			xa=a[0][i];
		}
		if(a[0][i]<xi) {
			xj=xi;
			xi=a[0][i];
		}
		if(a[1][i]>ya) {
			yb=ya;
			ya=a[1][i];
		}
		if(a[1][i]<yi) {
			yj=yi;
			yi=a[1][i];
		}
	}
	area=(long long)(xa-xi)*(long long)(ya-yi);
	for(j=K;j<N;j++) {
		if((a[0][j-K]==xa)&&(xb!=xa)) xa=xb;
		if((a[0][j-K]==xi)&&(xj!=xi)) xi=xj;
		if((a[1][j-K]==ya)&&(yb!=ya)) ya=yb;
		if((a[1][j-K]==yi)&&(yj!=yi)) yi=yj;
		if(a[0][j]>xa) {
			xb=xa;
			xa=a[0][j];
		}
		if(a[0][j]<xi) {
			xj=xi;
			xi=a[0][j];
		}
		if(a[1][j]>ya) {
			yb=ya;
			ya=a[1][j];
		}
		if(a[1][j]<yi) {
			yj=yi;
			yi=a[1][j];
		}
		if((long long)(xa-xi)*(long long)(ya-yi)<area) {
			area=(long long)(xa-xi)*(long long)(ya-yi);
		}
	
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:27: error: invalid conversion from 'int' to 'int (*)[50]' [-fpermissive]
   13 |         area=marea(a[2][50],N,K,0);
      |                    ~~~~~~~^
      |                           |
      |                           int
a.cc:3:25: note:   initializing argument 1 of 'long long int marea(int (*)[50], int, int, int)'
    3 | long long int marea(int a[2][50],int N,int K,int xory);
      |                     ~~~~^~~~~~~~
a.cc:14:33: error: invalid conversion from 'int' to 'int (*)[50]' [-fpermissive]
   14 |         if(area>(t=marea(a[2][50],N,K,1)) area=t;
      |                          ~~~~~~~^
      |                                 |
      |                                 int
a.cc:3:25: note:   initializing argument 1 of 'long long int marea(int (*)[50], int, int, int)'
    3 | long long int marea(int a[2][50],int N,int K,int xory);
      |                     ~~~~^~~~~~~~
a.cc:14:42: error: expected ';' before 'area'
   14 |         if(area>(t=marea(a[2][50],N,K,1)) area=t;
      |                                          ^~~~~
      |                                          ;
a.cc:15:30: error: expected ')' before ';' token
   15 |         printf("%lld\n",area);
      |                              ^
      |                              )
a.cc:14:11: note: to match this '('
   14 |         if(area>(t=marea(a[2][50],N,K,1)) area=t;
      |           ^
a.cc: In function 'long long int marea(int (*)[50], int, int, int)':
a.cc:50:13: error: 'i' was not declared in this scope
   50 |         for(i=1,xa=a[0][0],xi=a[0][0],ya=a[1][0],yi=a[1][0],xb=xa,xj=xi,yb=ya,yj=yi;i<K;i++) {
      |             ^
a.cc:50:17: error: 'xa' was not declared in this scope; did you mean 'a'?
   50 |         for(i=1,xa=a[0][0],xi=a[0][0],ya=a[1][0],yi=a[1][0],xb=xa,xj=xi,yb=ya,yj=yi;i<K;i++) {
      |                 ^~
      |                 a
a.cc:50:28: error: 'xi' was not declared in this scope
   50 |         for(i=1,xa=a[0][0],xi=a[0][0],ya=a[1][0],yi=a[1][0],xb=xa,xj=xi,yb=ya,yj=yi;i<K;i++) {
      |                            ^~
a.cc:50:39: error: 'ya' was not declared in this scope; did you mean 'a'?
   50 |         for(i=1,xa=a[0][0],xi=a[0][0],ya=a[1][0],yi=a[1][0],xb=xa,xj=xi,yb=ya,yj=yi;i<K;i++) {
      |                                       ^~
      |                                       a
a.cc:50:50: error: 'yi' was not declared in this scope
   50 |         for(i=1,xa=a[0][0],xi=a[0][0],ya=a[1][0],yi=a[1][0],xb=xa,xj=xi,yb=ya,yj=yi;i<K;i++) {
      |                                                  ^~
a.cc:50:61: error: 'xb' was not declared in this scope
   50 |         for(i=1,xa=a[0][0],xi=a[0][0],ya=a[1][0],yi=a[1][0],xb=xa,xj=xi,yb=ya,yj=yi;i<K;i++) {
      |                                                             ^~
a.cc:50:67: error: 'xj' was not declared in this scope
   50 |         for(i=1,xa=a[0][0],xi=a[0][0],ya=a[1][0],yi=a[1][0],xb=xa,xj=xi,yb=ya,yj=yi;i<K;i++) {
      |                                                                   ^~
a.cc:50:73: error: 'yb' was not declared in this scope
   50 |         for(i=1,xa=a[0][0],xi=a[0][0],ya=a[1][0],yi=a[1][0],xb=xa,xj=xi,yb=ya,yj=yi;i<K;i++) {
      |                                                                         ^~
a.cc:50:79: error: 'yj' was not declared in this scope
   50 |         for(i=1,xa=a[0][0],xi=a[0][0],ya=a[1][0],yi=a[1][0],xb=xa,xj=xi,yb=ya,yj=yi;i<K;i++) {
      |                                                                               ^~
a.cc:68:9: error: 'area' was not declared in this scope; did you mean 'marea'?
   68 |         area=(long long)(xa-xi)*(long long)(ya-yi);
      |         ^~~~
      |         marea
a.cc:68:26: error: 'xa' was not declared in this scope; did you mean 'a'?
   68 |         area=(long long)(xa-xi)*(long long)(ya-yi);
      |                          ^~
      |                          a
a.cc:68:29: error: 'xi' was not declared in this scope
   68 |         area=(long long)(xa-xi)*(long long)(ya-yi);
      |                             ^~
a.cc:68:45: error: 'ya' was not declared in this scope; did you mean 'a'?
   68 |         area=(long long)(xa-xi)*(long long)(ya-yi);
      |                                             ^~
      |                                             a
a.cc:68:48: error: 'yi' was not declared in this scope
   68 |         area=(long long)(xa-xi)*(long long)(ya-yi);
      |                                                ^~
a.cc:69:13: error: 'j' was not declared in this scope
   69 |         for(j=K;j<N;j++) {
      |             ^
a.cc:70:38: error: 'xb' was not declared in this scope
   70 |                 if((a[0][j-K]==xa)&&(xb!=xa)) xa=xb;
      |                                      ^~
a.cc:71:38: error: 'xj' was not declared in this scope
   71 |                 if((a[0][j-K]==xi)&&(xj!=xi)) xi=xj;
      |                                      ^~
a.cc:72:38: error: 'yb' was not declared in this scope
   72 |                 if((a[1][j-K]==ya)&&(yb!=ya)) ya=yb;
      |                                      ^~
a.cc:73:38: error: 'yj' was not declared in this scope
   73 |                 if((a[1][j-K]==yi)&&(yj!=yi)) yi=yj;
      |                                      ^~
a.cc:75:25: error: 'xb' was not declared in this scope
   75 |                         xb=xa;
      |                         ^~
a.cc:79:25: error: 'xj' was not declared in this scope
   79 |                         xj=xi;
      |                         ^~
a.cc:83:25: error: 'yb' was not declared in this scope
   83 |                         yb=ya;
      |                         ^~
a.cc:87:25: error: 'yj' was not declared in this scope
   87 |                         yj=yi;
      |                         ^~
a.cc:95:1: warning: no return statement in function returning non-void [-Wreturn-type]
   95 | }
      | ^