stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



using VI = vector<int>;

using VVI = vector<VI>;

using PII = pair<int, int>;

using LL = long long;

using VL = vector<LL>;

using VVL = vector<VL>;

using PLL = pair<LL, LL>;

using VS = vector<string>;



#define ALL(a)  begin((a)),end((a))

#define RALL(a) (a).rbegin(), (a).rend()

#define PB push_back

#define EB emplace_back

#define MP make_pair

#define SZ(a) int((a).size())

#define SORT(c) sort(ALL((c)))

#define RSORT(c) sort(RALL((c)))

#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))



#define FOR(i,a,b) for(int i=(a);i<(b);++i)

#define REP(i,n)  FOR(i,0,n)



#define FF first

#define SS second

template<class S, class T>

istream& operator>>(istream& is, pair<S,T>& p){

  return is >> p.FF >> p.SS;

}

template<class S, class T>

ostream& operator<<(ostream& os, const pair<S,T>& p){

  return os << p.FF << " " << p.SS;

}

template<class T>

void maxi(T& x, T y){

  if(x < y) x = y;

}

template<class T>

void mini(T& x, T y){

  if(x > y) x = y;

}





const double EPS = 1e-10;

const double PI  = acos(-1.0);

const LL MOD = 1e9+7;



int main(){

  cin.tie(0);

  ios_base::sync_with_stdio(false);



  LL N, M;

  cin >> N >> M;



  VL fact(100010);

  fact[0] = 1;

  for(LL i=1;i<100010;++i)

	fact[i] = (fact[i-1] * i) % MOD;



  if(abs(N-M) > 1){

	cout << 0 << endl;

  }

  else if(N == M){

	cout << fact[N] * fact[M] * 2 % MOD << endl;

  }

  else{

	if(N > M) swap(N, M);

	cout << fact[N] * fact[M] % MOD << endl;

  }



  return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.5940558038783064x):
#include <bits/stdc++.h>

using namespace std;



#define ENGZ ios::sync_with_stdio(0);cin.tie(0);ios_base::sync_with_stdio(0);

#define sfi(x) scanf("%d" , &x)

#define sfi2(x, y) scanf("%d%d" , &x,&y)

#define sfl2(x, y) scanf("%I64d%I64d" , &x,&y)

#define sfl(x) scanf("%I64d" , &x)

#define sfl3(x, y, z) scanf("%I64d%I64d%I64d", &x, &y, &z)

#define sfd(x) scanf("%lf", &x)

#define sfd2(x, y) scanf("%lf", &x, &y)

#define sfs(x) scanf("%s", &x)

#define testv(x) cerr << x << ' '

#define wtf(s) freopen((s), "w", stdout)

#define rff(s) freopen((s), "r", stdin)

#define test cerr << "here"

#define fst(x) cout << fixed << setprecision(x)

#define mod 1000000007

#define pi (2 * acos(0))

typedef long double ld;

typedef long long ll;

int main()

{

    ll n, m, a = 1, b = 1;

    cin >> n >> m;

    for (ll i = 1; i <= n; i++)

        a = (a * i) % mod;

    for (ll i = 1; i <= m; i++)

        b = (b * i) % mod;

    if (abs(n - m) >= 2)

        cout << 0;

    else if (m == n)

        cout << (((a * b) % mod) * 2) % mod;

    else

        cout << (a * b) % mod;

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

const int N = 2e5 + 5;

const long long mod = 1e9 + 7;

long long fact[N];

int main(){

    fact[0] = 1;

    for(int i = 1 ; i < N ; i++){

        fact[i] = fact[i - 1] * i;

        fact[i] %= mod;

    }

    int n, m;

    cin >> n >> m;

    if (n == m)

        cout << fact[n] * fact[m] % mod * 2 % mod;

    else if (abs(n - m) == 1){

        cout << fact[n] * fact[m] % mod;

    }

    else

        cout << 0;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.756248538434704x):
#include <bits/stdc++.h>

using namespace std;



#define ENGZ ios::sync_with_stdio(0);cin.tie(0);ios_base::sync_with_stdio(0);

#define sfi(x) scanf("%d" , &x)

#define sfi2(x, y) scanf("%d%d" , &x,&y)

#define sfl2(x, y) scanf("%I64d%I64d" , &x,&y)

#define sfl(x) scanf("%I64d" , &x)

#define sfl3(x, y, z) scanf("%I64d%I64d%I64d", &x, &y, &z)

#define sfd(x) scanf("%lf", &x)

#define sfd2(x, y) scanf("%lf", &x, &y)

#define sfs(x) scanf("%s", &x)

#define testv(x) cerr << x << ' '

#define wtf(s) freopen((s), "w", stdout)

#define rff(s) freopen((s), "r", stdin)

#define test cerr << "here"

#define fst(x) cout << fixed << setprecision(x)

#define mod 1000000007

#define pi (2 * acos(0))

typedef long double ld;

typedef long long ll;

int main()

{

    ll n, m, a = 1, b = 1;

    cin >> n >> m;

    for (ll i = 1; i <= n; i++)

        a = (a * i) % mod;

    for (ll i = 1; i <= m; i++)

        b = (b * i) % mod;

    if (abs(n - m) >= 2)

        cout << 0;

    else if (m == n)

        cout << (((a * b) % mod) * 2) % mod;

    else

        cout << (a * b) % mod;

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define MOD 1000000007

#define M(x) ((x) % MOD)

#define N 100001

using namespace std;



typedef unsigned ui;

typedef long long ll;

typedef unsigned long long ul;



ul f[N];



int main(void) {

	ios::sync_with_stdio(0); cin.tie(0);

#ifdef _DEBUG

	ifstream cin("1.in");

#endif

	for (ui i = f[0] = 1; i != N; ++i)

		f[i] = M(f[i - 1] * i);

	ll n, m;

	cin >> n >> m;

	if (abs(n - m) > 1) cout << 0 << endl;

	else {

		if (n == m) cout << M(2 * f[n] * f[n]) << endl;

		else cout << M(f[n] * f[m]) << endl;

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.8198257149892545x):
#include <bits/stdc++.h>

using namespace std;



long long mod=1e9+7;



long long n,m;

long long maxn,k;



int main()

{

    scanf("%lld%lld",&n,&m);

    if(abs(n-m)>1)

    {

        printf("0\n");

        return 0;

    }

    maxn=max(n,m);

    k=min(n,m);

    if(n==m)

    {

        long long ans=1;

        for(long long i=1;i<=maxn;i++)

        {

            ans=(ans*i)%mod;

        }

        ans=(ans*ans)%mod;

        printf("%lld",(ans*2)%mod);

    }

    else

    {

        long long ans=1;

        for(int i=1;i<=k;i++)

        {

            ans=(ans*i)%mod;

        }

        ans=(ans*ans)%mod;

        ans=(ans*maxn)%mod;

        printf("%lld",ans);

    }

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define MOD 1000000007

#define M(x) ((x) % MOD)

#define N 100001

using namespace std;



typedef unsigned ui;

typedef long long ll;

typedef unsigned long long ul;



ul f[N];



int main(void) {

	ios::sync_with_stdio(0); cin.tie(0);

#ifdef _DEBUG

	ifstream cin("1.in");

#endif

	for (ui i = f[0] = 1; i != N; ++i)

		f[i] = M(f[i - 1] * i);

	ll n, m;

	cin >> n >> m;

	if (abs(n - m) > 1) cout << 0 << endl;

	else {

		if (n == m) cout << M(2 * f[n] * f[n]) << endl;

		else cout << M(f[n] * f[m]) << endl;

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.8216449535623425x):
#include <bits/stdc++.h>

using namespace std;

const int mod = 1e9 + 7;



int main() {

#ifdef purple_bro

    freopen("in.txt", "r", stdin);

#endif // purple_bro

    int n, m;



    scanf("%d%d", &n, &m);



    if (abs(n - m) > 1)

        puts("0");

    else {

        int dog = 1, monkey = 1;

        for (int i = 1; i <= n; i++)

            dog = 1LL * dog * i % mod;

        for (int i = 1; i <= m; i++)

            monkey = 1LL * monkey * i % mod;

        int res = 1LL * dog * monkey % mod;

        if (!(n - m))

            res = res * 2 % mod;

        printf("%d\n", res);

    }



    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

#include<string.h>



using namespace std;



int main()

{

    int num;

    cin>>num;

    if(num%10==9 || num/10==9)

    {

        cout<<"Yes";

    }

    else{

        cout<<"No";

    }

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 5.298153833708806x):
#include<stdio.h>

#include<stdlib.h>

#include<math.h>

int main()

{

    int a,x,y;

    scanf("%d",&a);

    x=a%10;

    y=a/10;

    if(x == 9 || y == 9)

    {

        printf("Yes\n");

    }

    else

        printf("No\n");

    return 0;

}
// Slower C++ solution:


#include<bits/stdc++.h>

using namespace std;

int main()

{

    string s;

    cin>>s;



    bool  flag = false;

    for(int i = 0 ; i<s.length();i++)

    {

        if(s[i] == '9')

            flag = true;

    }

    if(flag)

        printf("Yes");

    else

        printf("No");

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.27685324659699x):
#include<stdio.h>

#include<stdlib.h>

#include<math.h>

int main()

{

    int a,x,y;

    scanf("%d",&a);

    x=a%10;

    y=a/10;

    if(x == 9 || y == 9)

    {

        printf("Yes\n");

    }

    else

        printf("No\n");

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <math.h>

using namespace std ;

int lg10(int x ){

	int cnt = 0 ;

	while ( x != 0 ) {

		x /= 10 ;

		cnt ++ ;

	}

	return cnt ;

}

int main(int argc, char** argv) {

	int n ;

	cin >> n ;

	int div1 = 10 , div2 = 1 ;

	string ans = "No" ;

	for ( int i = 0 ; i < lg10(n) ; i++ ) {

		if ( ( n % div1 ) / div2 == 9 ) {

			ans = "Yes" ;

			break ;

		} 

		div1 *= 10 ;

		div2 *= 10 ;

	}

	cout << ans ;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.291414796642923x):
#include<stdio.h>

int main()

{

	int angka;

	scanf("%d",&angka);

	if(angka%10==9||angka/10==9){

		printf("Yes\n");

	}

	else{

		printf("No\n");

	}

	return 0;

}
// Slower C++ solution:
//Be Name Khoda

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

typedef long double ld;

const int MOD = (int)1e9 + 7;

const int MAXN = (int)1e6 + 7;

bool f(string s)

{

	if(s.size() < 7)

		return false;

	if(s[0] == 'd' and s[1] == 'r' and s[2] == 'e' and s[3] == 'a' and s[4] == 'm' and s[5] == 'e' and s[6] == 'r')

		return true;

	return false;

}



int main()

{

	ios::sync_with_stdio(false);

	cin.tie(0); cout.tie(0);

	int n;

	cin >> n;

	while(n)

	{

		if((n % 10) == 9)

			return cout << "Yes", 0;

		n /= 10;

	}

	cout << "No";

}

// Faster C++ solution for the same problem (measured speedup: 5.3757726755121675x):
#include<stdio.h>

int main()

{

	int angka;

	scanf("%d",&angka);

	if(angka%10==9||angka/10==9){

		printf("Yes\n");

	}

	else{

		printf("No\n");

	}

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int main()

{

    int a;

    cin>>a;

    if(a%10==9||a/10==9)

        {cout<<"Yes"<<endl;}

    else

    {

        cout<<"No"<<endl;

    }return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.309321592640795x):
#include<stdio.h>

int main()

{

	int angka;

	scanf("%d",&angka);

	if(angka%10==9||angka/10==9){

		printf("Yes\n");

	}

	else{

		printf("No\n");

	}

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int main()

{

    int n;

    cin>>n;

    if(n/10==9 || n%10==9)

    {

        cout<<"Yes"<<endl;

    }

    else

    {

        cout<<"No"<<endl;

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.310240608778755x):
#include<stdio.h>

int main()

{

	int angka;

	scanf("%d",&angka);

	if(angka%10==9||angka/10==9){

		printf("Yes\n");

	}

	else{

		printf("No\n");

	}

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <math.h>

using namespace std ;

int lg10(int x ){

	int cnt = 0 ;

	while ( x != 0 ) {

		x /= 10 ;

		cnt ++ ;

	}

	return cnt ;

}

int main(int argc, char** argv) {

	int n ;

	cin >> n ;

	int div1 = 10 , div2 = 1 ;

	string ans = "No" ;

	for ( int i = 0 ; i < lg10(n) ; i++ ) {

		if ( ( n % div1 ) / div2 == 9 ) {

			ans = "Yes" ;

			break ;

		} 

		div1 *= 10 ;

		div2 *= 10 ;

	}

	cout << ans ;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.291750610829759x):
#include<stdio.h>



int main()

{

	int a;

	scanf("%d",&a);



	if(a/10==9 || a%10==9)

		printf("Yes\n");

	else

		printf("No\n");

	

		

	return 0;

}
// Slower C++ solution:
//Be Name Khoda

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

typedef long double ld;

const int MOD = (int)1e9 + 7;

const int MAXN = (int)1e6 + 7;

bool f(string s)

{

	if(s.size() < 7)

		return false;

	if(s[0] == 'd' and s[1] == 'r' and s[2] == 'e' and s[3] == 'a' and s[4] == 'm' and s[5] == 'e' and s[6] == 'r')

		return true;

	return false;

}



int main()

{

	ios::sync_with_stdio(false);

	cin.tie(0); cout.tie(0);

	int n;

	cin >> n;

	while(n)

	{

		if((n % 10) == 9)

			return cout << "Yes", 0;

		n /= 10;

	}

	cout << "No";

}

// Faster C++ solution for the same problem (measured speedup: 5.376113843384848x):
#include<stdio.h>



int main()

{

	int a;

	scanf("%d",&a);



	if(a/10==9 || a%10==9)

		printf("Yes\n");

	else

		printf("No\n");

	

		

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int main()

{

    int a;

    cin>>a;

    if(a%10==9||a/10==9)

        {cout<<"Yes"<<endl;}

    else

    {

        cout<<"No"<<endl;

    }return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.309658543263985x):
#include<stdio.h>



int main()

{

	int a;

	scanf("%d",&a);



	if(a/10==9 || a%10==9)

		printf("Yes\n");

	else

		printf("No\n");

	

		

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int main()

{

    int n;

    cin>>n;

    if(n/10==9 || n%10==9)

    {

        cout<<"Yes"<<endl;

    }

    else

    {

        cout<<"No"<<endl;

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.310577617726357x):
#include<stdio.h>



int main()

{

	int a;

	scanf("%d",&a);



	if(a/10==9 || a%10==9)

		printf("Yes\n");

	else

		printf("No\n");

	

		

	return 0;

}
// Slower C++ solution:
#include <iostream>



using namespace std;



int main()

{

    int n;

    cin >> n;

    if(n % 10 == 9 || n / 10 == 9){

        cout << "Yes";

    }

    else{

        cout << "No";

    }

}


// Faster C++ solution for the same problem (measured speedup: 5.298076578665134x):
#include <stdio.h>

int main()

{ 

  int a;

  scanf("%d",&a);

  if((a/10==9)||a==9||(a%10==9))  printf("Yes\n");

   else printf("No\n");

return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>



using namespace std;



int main()

{



    int a;

    cin>>a;

    if(a/10==9||a%10==9)cout<<"Yes"<<endl;

    else cout<<"No"<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.310566533265137x):
#include <stdio.h>

int main()

{ 

  int a;

  scanf("%d",&a);

  if((a/10==9)||a==9||(a%10==9))  printf("Yes\n");

   else printf("No\n");

return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int main(){

	int a;

	for(;cin>>a;){

	if(a%10==9||a/10==9)

	cout<<"Yes"<<endl;	

	else

	cout<<"No"<<endl;

}

	return 0;

} 

// Faster C++ solution for the same problem (measured speedup: 5.313083075826528x):
#include <stdio.h>

int main()

{ 

  int a;

  scanf("%d",&a);

  if((a/10==9)||a==9||(a%10==9))  printf("Yes\n");

   else printf("No\n");

return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int n;

   while(~scanf("%d",&n))

   {

       if(n%10==9||n/10==9)

    {

        printf("Yes\n");

    }

    else

        printf("No\n");

    return 0;

   } 

}




// Faster C++ solution for the same problem (measured speedup: 5.243604201212591x):
#include <stdio.h>

int main()

{ 

  int a;

  scanf("%d",&a);

  if((a/10==9)||a==9||(a%10==9))  printf("Yes\n");

   else printf("No\n");

return 0;

}
// Slower C++ solution:
#include <iostream>



using namespace std;



int main()

{

    int n;

    cin >> n;

    if(n % 10 == 9 || n / 10 == 9){

        cout << "Yes";

    }

    else{

        cout << "No";

    }

}


// Faster C++ solution for the same problem (measured speedup: 5.305403703319295x):
#include <stdio.h>



int main(){

	int n = 0;

	scanf("%d",&n);

	

	int modulo = n%10;

	int bagi = n/10;

	

	if(modulo==9 || bagi==9){

		printf("Yes\n");

	}else{

		printf("No\n");

	}

	

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>



using namespace std;



int main()

{



    int a;

    cin>>a;

    if(a/10==9||a%10==9)cout<<"Yes"<<endl;

    else cout<<"No"<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.317910931254804x):
#include <stdio.h>



int main(){

	int n = 0;

	scanf("%d",&n);

	

	int modulo = n%10;

	int bagi = n/10;

	

	if(modulo==9 || bagi==9){

		printf("Yes\n");

	}else{

		printf("No\n");

	}

	

	return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int main(){

	int a;

	for(;cin>>a;){

	if(a%10==9||a/10==9)

	cout<<"Yes"<<endl;	

	else

	cout<<"No"<<endl;

}

	return 0;

} 

// Faster C++ solution for the same problem (measured speedup: 5.320430954139813x):
#include <stdio.h>



int main(){

	int n = 0;

	scanf("%d",&n);

	

	int modulo = n%10;

	int bagi = n/10;

	

	if(modulo==9 || bagi==9){

		printf("Yes\n");

	}else{

		printf("No\n");

	}

	

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int n;

   while(~scanf("%d",&n))

   {

       if(n%10==9||n/10==9)

    {

        printf("Yes\n");

    }

    else

        printf("No\n");

    return 0;

   } 

}




// Faster C++ solution for the same problem (measured speedup: 5.250855991753726x):
#include <stdio.h>



int main(){

	int n = 0;

	scanf("%d",&n);

	

	int modulo = n%10;

	int bagi = n/10;

	

	if(modulo==9 || bagi==9){

		printf("Yes\n");

	}else{

		printf("No\n");

	}

	

	return 0;

}
// Slower C++ solution:
#include <iostream>



using namespace std;



int main()

{

    int n;

    cin >> n;

    if(n % 10 == 9 || n / 10 == 9){

        cout << "Yes";

    }

    else{

        cout << "No";

    }

}


// Faster C++ solution for the same problem (measured speedup: 5.292478767837162x):
#include<stdio.h>



int main(){



	char n[100];

	int cek=0;

	scanf("%s",n);

	printf("%s\n",  n[0]=='9' || n[1]=='9' ? "Yes" : "No");

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>



using namespace std;



int main()

{



    int a;

    cin>>a;

    if(a/10==9||a%10==9)cout<<"Yes"<<endl;

    else cout<<"No"<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.304955525873834x):
#include<stdio.h>



int main(){



	char n[100];

	int cek=0;

	scanf("%s",n);

	printf("%s\n",  n[0]=='9' || n[1]=='9' ? "Yes" : "No");

	return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int main(){

	int a;

	for(;cin>>a;){

	if(a%10==9||a/10==9)

	cout<<"Yes"<<endl;	

	else

	cout<<"No"<<endl;

}

	return 0;

} 

// Faster C++ solution for the same problem (measured speedup: 5.307469409521374x):
#include<stdio.h>



int main(){



	char n[100];

	int cek=0;

	scanf("%s",n);

	printf("%s\n",  n[0]=='9' || n[1]=='9' ? "Yes" : "No");

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int n;

   while(~scanf("%d",&n))

   {

       if(n%10==9||n/10==9)

    {

        printf("Yes\n");

    }

    else

        printf("No\n");

    return 0;

   } 

}




// Faster C++ solution for the same problem (measured speedup: 5.2380639444912465x):
#include<stdio.h>



int main(){



	char n[100];

	int cek=0;

	scanf("%s",n);

	printf("%s\n",  n[0]=='9' || n[1]=='9' ? "Yes" : "No");

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

const int maxn=50;

const long long maxl=1000000000;

long long sx=maxl+1,bx=-maxl-1,sy=maxl+1,by=-maxl-1;

long long x[maxn+1],y[maxn+1];

int n,k;

long long ans=(maxl*2+1)*(maxl*2+1);

void dfs(int p,int c){

	if(c+n-(p-1)<k)return;

	long long ar=(bx-sx)*(by-sy);

	if(c>0&&ar>=ans)return;

	if(p==n+1){

		ans=min(ans,ar);

		return;

	}

	//point p not chosen

	dfs(p+1,c);

	

	//point p chosen

	long long _sx=sx,_bx=bx,_sy=sy,_by=by;

	sx=min(sx,x[p]);bx=max(bx,x[p]);

	sy=min(sy,y[p]);by=max(by,y[p]);

	dfs(p+1,c+1);

	sx=_sx;bx=_bx;sy=_sy;by=_by;

}

	

int main(int argc,char *argv[]){

	if(argc>=2){freopen(argv[1],"r",stdin);}

	if(argc>=3){freopen(argv[2],"w",stdout);}

	scanf("%d%d",&n,&k);

	for(int i=1;i<=n;++i)scanf("%lld%lld",&x[i],&y[i]);

	dfs(1,0);

	printf("%lld",ans);

	fclose(stdin);fclose(stdout);

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.723169134485562x):
#include<stdio.h>

#include<stdlib.h>

struct node

{

	long long x,y;

	int a,b;

}point[55];

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

{

    struct node m = *(struct node *)a;

    struct node n = *(struct node *)b;

    if(m.x<n.x) return -1;

    else return 1;

}

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

{

    struct node m = *(struct node *)a;

    struct node n = *(struct node *)b;

    if(m.y<n.y) return -1;

    else return 1;

}

int main()

{

	int n,k,mp[55][55],xmax,ymax,temp;

	bool np[55][55];

	long long x[55],y[55],S,min=-1,xx[55],yy[55],Smax=-1;

	for(int i=0;i<55;i++)

	{

		for(int j=0;j<55;j++)

		{

			mp[i][j]=0;

			np[i][j]=false;

		}

	}

	scanf("%d%d",&n,&k);

	for(int i=0;i<n;i++)scanf("%lld%lld",&point[i].x,&point[i].y);

	qsort(point,n,sizeof(struct node),incx);

	temp=0;

	for(int i=0;i<n;i++)

	{

		point[i].a=temp;

		xx[temp]=point[i].x;

		temp++;

	}

	qsort(point,n,sizeof(struct node),incy);

	temp=0;

	for(int i=0;i<n;i++)

	{

		point[i].b=temp;

		np[point[i].a][point[i].b]=true;

		yy[temp]=point[i].y;

		temp++;

	}

	if(np[0][0]==false)mp[0][0]=0;

	else mp[0][0]=1;

	for(int i=0;i<n;i++)

	{

		for(int j=0;j<n;j++)

		{

			if(i==0)mp[i][j]=mp[i][j-1]+np[i][j];

			else if(j==0)mp[i][j]=mp[i-1][j]+np[i][j];

			else mp[i][j]=mp[i-1][j]+mp[i][j-1]-mp[i-1][j-1]+np[i][j];

		}

	}

	for(int i=0;i<n;i++)

	{

		for(int j=0;j<n;j++)

		{

			for(int p=i+1;p<n;p++)

			{

				for(int q=j+1;q<n;q++)

				{

					int sum;

					if(i==0)sum=mp[p][q]-mp[p][j-1];

					else if(j==0)sum=mp[p][q]-mp[i-1][q];

					else sum=mp[p][q]-mp[i-1][q]-mp[p][j-1]+mp[i-1][j-1];

					if(sum>=k)

					{

						if((xx[p]-xx[i])*(yy[q]-yy[j])<=Smax||Smax<0)Smax=(xx[p]-xx[i])*(yy[q]-yy[j]);

					}

				}

			}

		}

	}

	printf("%lld\n",Smax);

}