stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <iostream>

#include <cmath>



using namespace std;



int main()

{

    int r; cin >> r;

    double a = 3 * pow(r, 2);

    cout << a;

    return 0;

}


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



int main(){

int a,rumus;

scanf("%d", &a);

rumus = 3*(a*a);



printf("%d",rumus);









return 0;

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



using namespace std;



int main()

{

 int n;cin>>n;

 cout<<3*(n*n);

    return 0;

}


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



int main(){

int a,rumus;

scanf("%d", &a);

rumus = 3*(a*a);



printf("%d",rumus);









return 0;

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

using namespace std;



int main()

{

    int a,area;

    cin>>a;

    area=3*a*a;

    cout<<area;

    return 0;

}


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



int main(){

int a,rumus;

scanf("%d", &a);

rumus = 3*(a*a);



printf("%d",rumus);









return 0;

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





int main()

{

    int n;

    std::cin >> n;

    std::cout << 3 * n * n;

    return 0;

}

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



int main(){

int a,rumus;

scanf("%d", &a);

rumus = 3*(a*a);



printf("%d",rumus);









return 0;

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

using namespace std;

int main()

{

	int n,m,l,a,b;

	long long int s;

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

	{

		 s=n*n*3;

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

	}

	

	 

}

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



int main() {

	int r;

	scanf("%d", &r);

	int area = 3*(r*r);

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

	

	return 0;

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

#include <cmath>



using namespace std;



int main()

{

    int r; cin >> r;

    double a = 3 * pow(r, 2);

    cout << a;

    return 0;

}


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



int main() {

	int r;

	scanf("%d", &r);

	int area = 3*(r*r);

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

	

	return 0;

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



using namespace std;



int main()

{

 int n;cin>>n;

 cout<<3*(n*n);

    return 0;

}


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



int main() {

	int r;

	scanf("%d", &r);

	int area = 3*(r*r);

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

	

	return 0;

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

using namespace std;



int main()

{

    int a,area;

    cin>>a;

    area=3*a*a;

    cout<<area;

    return 0;

}


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



int main() {

	int r;

	scanf("%d", &r);

	int area = 3*(r*r);

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

	

	return 0;

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





int main()

{

    int n;

    std::cin >> n;

    std::cout << 3 * n * n;

    return 0;

}

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



int main() {

	int r;

	scanf("%d", &r);

	int area = 3*(r*r);

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

	

	return 0;

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

using namespace std;

int main()

{

	int n,m,l,a,b;

	long long int s;

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

	{

		 s=n*n*3;

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

	}

	

	 

}

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



int main(){

	int a,r;

	scanf("%d",&r);

	a=3*r*r;

	printf("%d",a);

	return 0;

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

#include <cmath>



using namespace std;



int main()

{

    int r; cin >> r;

    double a = 3 * pow(r, 2);

    cout << a;

    return 0;

}


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



int main(){

	int a,r;

	scanf("%d",&r);

	a=3*r*r;

	printf("%d",a);

	return 0;

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



using namespace std;



int main()

{

 int n;cin>>n;

 cout<<3*(n*n);

    return 0;

}


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



int main(){

	int a,r;

	scanf("%d",&r);

	a=3*r*r;

	printf("%d",a);

	return 0;

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

using namespace std;



int main()

{

    int a,area;

    cin>>a;

    area=3*a*a;

    cout<<area;

    return 0;

}


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



int main(){

	int a,r;

	scanf("%d",&r);

	a=3*r*r;

	printf("%d",a);

	return 0;

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





int main()

{

    int n;

    std::cin >> n;

    std::cout << 3 * n * n;

    return 0;

}

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



int main(){

	int a,r;

	scanf("%d",&r);

	a=3*r*r;

	printf("%d",a);

	return 0;

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

using namespace std;

int main()

{

	int n,m,l,a,b;

	long long int s;

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

	{

		 s=n*n*3;

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

	}

	

	 

}

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



int main(){

    int rad;

    scanf("%d", &rad);

    

    printf("%d\n", 3*rad*rad);

    return 0;

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

#include <cmath>



using namespace std;



int main()

{

    int r; cin >> r;

    double a = 3 * pow(r, 2);

    cout << a;

    return 0;

}


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



int main(){

    int rad;

    scanf("%d", &rad);

    

    printf("%d\n", 3*rad*rad);

    return 0;

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



using namespace std;



int main()

{

 int n;cin>>n;

 cout<<3*(n*n);

    return 0;

}


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



int main(){

    int rad;

    scanf("%d", &rad);

    

    printf("%d\n", 3*rad*rad);

    return 0;

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

using namespace std;



int main()

{

    int a,area;

    cin>>a;

    area=3*a*a;

    cout<<area;

    return 0;

}


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



int main(){

    int rad;

    scanf("%d", &rad);

    

    printf("%d\n", 3*rad*rad);

    return 0;

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





int main()

{

    int n;

    std::cin >> n;

    std::cout << 3 * n * n;

    return 0;

}

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



int main(){

    int rad;

    scanf("%d", &rad);

    

    printf("%d\n", 3*rad*rad);

    return 0;

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

using namespace std;

int main()

{

	int n,m,l,a,b;

	long long int s;

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

	{

		 s=n*n*3;

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

	}

	

	 

}

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



int main() {

    int r ;

    scanf("%d", &r) ;

    printf("%d\n", 3*r*r) ;



    return 0;

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

#include <cmath>



using namespace std;



int main()

{

    int r; cin >> r;

    double a = 3 * pow(r, 2);

    cout << a;

    return 0;

}


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



int main() {

    int r ;

    scanf("%d", &r) ;

    printf("%d\n", 3*r*r) ;



    return 0;

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



using namespace std;



int main()

{

 int n;cin>>n;

 cout<<3*(n*n);

    return 0;

}


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



int main() {

    int r ;

    scanf("%d", &r) ;

    printf("%d\n", 3*r*r) ;



    return 0;

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

using namespace std;



int main()

{

    int a,area;

    cin>>a;

    area=3*a*a;

    cout<<area;

    return 0;

}


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



int main() {

    int r ;

    scanf("%d", &r) ;

    printf("%d\n", 3*r*r) ;



    return 0;

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





int main()

{

    int n;

    std::cin >> n;

    std::cout << 3 * n * n;

    return 0;

}

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



int main() {

    int r ;

    scanf("%d", &r) ;

    printf("%d\n", 3*r*r) ;



    return 0;

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

using namespace std;

int main()

{

	int n,m,l,a,b;

	long long int s;

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

	{

		 s=n*n*3;

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

	}

	

	 

}

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



int main(){

   int r;

   scanf("%d", &r);

   int area = 3*r*r;

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

    

    return 0;

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

#include <cmath>



using namespace std;



int main()

{

    int r; cin >> r;

    double a = 3 * pow(r, 2);

    cout << a;

    return 0;

}


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



int main(){

   int r;

   scanf("%d", &r);

   int area = 3*r*r;

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

    

    return 0;

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



using namespace std;



int main()

{

 int n;cin>>n;

 cout<<3*(n*n);

    return 0;

}


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



int main(){

   int r;

   scanf("%d", &r);

   int area = 3*r*r;

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

    

    return 0;

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

using namespace std;



int main()

{

    int a,area;

    cin>>a;

    area=3*a*a;

    cout<<area;

    return 0;

}


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



int main(){

   int r;

   scanf("%d", &r);

   int area = 3*r*r;

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

    

    return 0;

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





int main()

{

    int n;

    std::cin >> n;

    std::cout << 3 * n * n;

    return 0;

}

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



int main(){

   int r;

   scanf("%d", &r);

   int area = 3*r*r;

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

    

    return 0;

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

using namespace std;

int main()

{

	int n,m,l,a,b;

	long long int s;

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

	{

		 s=n*n*3;

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

	}

	

	 

}

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

int main(){

	int r;

	int sum;

	scanf("%d", &r);

	sum = 3*r*r;

	printf("%d", sum);

	return 0;

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

#include <cmath>



using namespace std;



int main()

{

    int r; cin >> r;

    double a = 3 * pow(r, 2);

    cout << a;

    return 0;

}


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

int main(){

	int r;

	int sum;

	scanf("%d", &r);

	sum = 3*r*r;

	printf("%d", sum);

	return 0;

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



using namespace std;



int main()

{

 int n;cin>>n;

 cout<<3*(n*n);

    return 0;

}


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

int main(){

	int r;

	int sum;

	scanf("%d", &r);

	sum = 3*r*r;

	printf("%d", sum);

	return 0;

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

using namespace std;



int main()

{

    int a,area;

    cin>>a;

    area=3*a*a;

    cout<<area;

    return 0;

}


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

int main(){

	int r;

	int sum;

	scanf("%d", &r);

	sum = 3*r*r;

	printf("%d", sum);

	return 0;

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





int main()

{

    int n;

    std::cin >> n;

    std::cout << 3 * n * n;

    return 0;

}

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

int main(){

	int r;

	int sum;

	scanf("%d", &r);

	sum = 3*r*r;

	printf("%d", sum);

	return 0;

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

using namespace std;

int main()

{

	int n,m,l,a,b;

	long long int s;

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

	{

		 s=n*n*3;

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

	}

	

	 

}

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



int main(){

	int angka;

	scanf("%d", &angka);

	printf("%d\n", angka*angka*3);

	return 0;

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

#include <cmath>



using namespace std;



int main()

{

    int r; cin >> r;

    double a = 3 * pow(r, 2);

    cout << a;

    return 0;

}


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



int main(){

	int angka;

	scanf("%d", &angka);

	printf("%d\n", angka*angka*3);

	return 0;

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



using namespace std;



int main()

{

 int n;cin>>n;

 cout<<3*(n*n);

    return 0;

}


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



int main(){

	int angka;

	scanf("%d", &angka);

	printf("%d\n", angka*angka*3);

	return 0;

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

using namespace std;



int main()

{

    int a,area;

    cin>>a;

    area=3*a*a;

    cout<<area;

    return 0;

}


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



int main(){

	int angka;

	scanf("%d", &angka);

	printf("%d\n", angka*angka*3);

	return 0;

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





int main()

{

    int n;

    std::cin >> n;

    std::cout << 3 * n * n;

    return 0;

}

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



int main(){

	int angka;

	scanf("%d", &angka);

	printf("%d\n", angka*angka*3);

	return 0;

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

#include<cstdio>

#include<string>

#include<set>



using namespace std;



int n;

int num[5];

int card[11];

set<string> ans;



void serch(int m,int k,int now)

{

	

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

	{

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

		{

			if(num[i]==num[j])

			{

				return;

			}

		}

	}

	

	if(m==k)

	{

		string str;

		char  ch[8];

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

		{

			sprintf(ch,"%d",card[num[i]]);

			str+=string(ch);

		}

		ans.insert(str);

		return ;

	}

	

	num[m]=now;

	

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

	{

		serch(m+1,k,i);

	}

	

	return ;

}



int main()

{

	int k;

	int i,j;

	

	for(;;)

	{

		cin >> n >> k;

		if(n==0 && k==0)

			break;

		

		ans.clear();

		

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

			cin >> card[i] ;

		

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

		{

			serch(0,k,i);

		}

		

		set<string>::iterator it = ans.begin();

		

/*

		for(;it!=ans.end();++it)

		{

			cout << "ans:" << *it << endl;

		}

*/

		

		cout << ans.size() << endl;

	}

	

}

// Faster C++ solution for the same problem (measured speedup: 1.757055758568161x):
#include<iostream>

#include<vector>

#include<set>

#include<string>



using namespace std;



int n,m;

vector<int> came;

string str[11];

set<string> ans;



void serch(int loop,string sans)

{

//	cout << "loop:" << loop << endl;

	if(loop==m)

	{

//		cout << "came:" ;

//		for(int i=0;i<came.size();i++)

//			cout <<  came[i] << " " ;

//		cout << endl;

//		cout << sans << endl;;

		ans.insert(sans);

		return ;

	}

	

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

	{

		for(int j=0;j<came.size();j++)

		{

//				cout << "j:" << j << " now:" << came[j] << " size:" << came.size() << " " << i << endl;

			if(i==came[j])

			{

				i++;

				j=-1;

			}

		}

		if(i==n)

			break;

//		cout << "next:" << i << endl;

		came.push_back(i);

		serch(loop+1,sans+str[i]);

		came.pop_back();

	}

	return ;

}



int main()

{

	int i,j;

	for(;;)

	{

		cin >> n >> m ;

		if(n==0 && m==0)

			break;

		

		ans.clear();

		

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

			cin >> str[i] ;

		

		serch(0,"");

		

		cout << ans.size() << endl;

	}

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



using namespace std;

long long x,y;

int nr;

int main()

{

    cin>>x>>y;

    nr=1;

    while(x*2<=y){

        nr++;

        x*=2;



    }

    cout<<nr;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.258806553549741x):
#include<cstdio>



int main(){

    long long x, y;

    scanf("%lld%lld",&x,&y);

    int sum = 0;

    y /= x;

    while(y){

        sum++;

        y>>=1;

    }

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

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

using namespace std;

typedef long long LL;

const int INF = 0x3f3f3f3f;

const LL mod = 1e9 + 7;

const int N = 300005;



int a[N], b[N];

vector<int> G[N];

int val[N << 2];

void update(int u, int l, int r, int x, int v) {

    if (l == r) {

        val[u] += v;

        return;

    }

    int mid = l + r >> 1;

    if (x <= mid)

        update(u << 1, l, mid, x, v);

    else

        update(u << 1 | 1, mid + 1, r, x, v);

    val[u] = max(val[u << 1], val[u << 1 | 1]);

}

int main() {

    int n, m, g;

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

    for (int i = 0; i < g; i++) {

        int x, y;

        scanf("%d%d", &x, &y);

        a[x]++;

        update(1, 1, m, y, 1);

        G[x].push_back(y);

    }



    int ans = 0;

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

        for (auto y : G[i]) update(1, 1, m, y, -1);

        ans = max(ans, a[i] + val[1]);

        for (auto y : G[i]) update(1, 1, m, y, 1);

    }

    cout << ans << endl;

    return 0;

}


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

using namespace std;

typedef long long LL;

const int INF = 0x3f3f3f3f;

const LL mod = 1e9 + 7;

const int N = 300005;



int a[N], b[N];

vector<int> c, d;

int main() {

    int n, m, g;

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

    set<pair<int, int> > se;

    for (int i = 0; i < g; i++) {

        int x, y;

        scanf("%d%d", &x, &y);

        se.insert({x, y});

        a[x]++;

        b[y]++;

    }

    int mx1 = 0, mx2 = 0;

    for (int i = 1; i <= n; i++) mx1 = max(mx1, a[i]);

    for (int i = 1; i <= m; i++) mx2 = max(mx2, b[i]);

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

        if (mx1 == a[i]) c.push_back(i);

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

        if (mx2 == b[i]) d.push_back(i);

    for (auto x : c) {

        for (auto y : d) {

            if (se.count({x, y}) == 0) {

                printf("%d\n", mx1 + mx2);

                return 0;

            }

        }

    }

    printf("%d\n", mx1 + mx2 - 1);

    return 0;

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

using namespace std;



#define ll long long

#define fi first

#define se second

#define inf 1e15



#define N 300005



vector<int>row[N];



multiset<int>Noofbombsincolumnsset;



int bombsineachcolumn[N];



void upd(int pos,int delta){

    

    Noofbombsincolumnsset.erase(Noofbombsincolumnsset.find(bombsineachcolumn[pos]));

    

    bombsineachcolumn[pos]+=delta;

    

    Noofbombsincolumnsset.insert(bombsineachcolumn[pos]);

    

}

int main() {

    

    ios_base::sync_with_stdio(false);

    cin.tie(NULL); cout.tie(NULL);

    

	int t=1;

//	cin>>t;

	while(t--){

	    

	    int n,m,k;

	    cin>>n>>m>>k;

	    

	    for(int i=0;i<m;i++){

	        Noofbombsincolumnsset.insert(0);

	        bombsineachcolumn[i]=0;

	    }

	    for(int i=0;i<k;i++){

	        int x,y;

	        cin>>x>>y;

	        x--;y--;

	        row[x].push_back(y);

	        //add

	        upd(y,1);

	    }

	    int ans=0;

	    

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

	        

	        int cnt=row[i].size();

	        

	        for(auto y:row[i]){

	            //remove

	            upd(y,-1);

	        }

	        

	        cnt+= *Noofbombsincolumnsset.rbegin();

	        

	        ans=max(ans,cnt);

	        

	        for(auto y:row[i]){

	            //add

	            upd(y,1);

	        }

	        

	    }

	    

	    cout<<ans<<"\n";

	    

	    

	}

	return 0;

}


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

using namespace std;



#define ll long long

#define fi first

#define se second

#define inf 1e15



#define N 300005



int row[N];

int col[N];



vector<int>rowv,colv;



set<pair<int,int>>bomb;



int main() {

    

    ios_base::sync_with_stdio(false);

    cin.tie(NULL); cout.tie(NULL);

    

	int t=1;

	//cin>>t;

	while(t--){

	    

	    int n,m,k;

	    cin>>n>>m>>k;

	    

        int rowh=0,colh=0;

	    for(int i=0;i<k;i++){

	        int x,y;

	        cin>>x>>y;

	        x--;y--;

	        

	        bomb.insert({x,y});

	        

	        row[x]++;

	        col[y]++;

	        

	        rowh=max(rowh,row[x]);

	        colh=max(colh,col[y]);

	    }

	    

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

	        if(row[i]==rowh){

	            rowv.push_back(i);

	        }

	    }

	     for(int i=0;i<m;i++){

	        if(col[i]==colh){

	            colv.push_back(i);

	        }

	    }

	    

	    ll ans=rowh+colh-1;

	    

	    for(auto i:rowv){

	        for(auto j:colv){

	            

	            if(bomb.find({i,j})==bomb.end()){

	                ans++;

	                goto end;

	                

	            }

	        }

	    }

	    

	    end:

	    cout<<ans<<"\n";

	    

	    

	}

	return 0;

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

#define N 300001

using namespace std;

int n,mxx,mxy,sx[N],sy[N];

vector<int>gx,gy;

map<pair<int,int>,char>mp;

int main(void){

	int i,x,y;scanf("%d%d%d",&x,&y,&n);

	while(n--)scanf("%d%d",&x,&y),mxx=max(mxx,++sx[x]),mxy=max(mxy,++sy[y]),mp[make_pair(x,y)]=1;

	for(i=1;i<=300000;++i)if(sx[i]==mxx)gx.push_back(i);

	for(i=1;i<=300000;++i)if(sy[i]==mxy)gy.push_back(i);

	for(int x:gx)for(int y:gy)if(!mp.count(make_pair(x,y)))return printf("%d\n",mxx+mxy),0;//至少一对不重合 

	printf("%d\n",mxx+mxy-1);//都必定重叠 

	return 0;

}


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

using namespace std;

typedef long long ll;

const int MAX = 3e5 + 10;

const int INF=0x3f3f3f3f;

const int mod=1e9+7;



int h1,w1,m,bsum=0,csum=0,bs,cs;

ll a[MAX],b[MAX],c[MAX],d[MAX];



void solve() {

    cin>>h1>>w1>>m;

    for (int i=1;i<=m;++i)  cin>>a[i]>>d[i],b[a[i]]++,c[d[i]]++;

    for (int k = 1; k <=h1; ++k) {

        if (b[k]>bsum)bsum=b[k],bs=1;

        else if (b[k]==bsum) bs++;

    }

    for (int k = 1; k <=w1; ++k) {

        if (c[k]>csum)csum=c[k],cs=1;

        else if (c[k]==csum) cs++;

    }

    int flag=0;

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

        if (b[a[j]]==bsum&&c[d[j]]==csum)flag++;

    //cout<<bs<<" "<<cs<<" "<<flag<<" "<<bsum<<" "<<csum<<endl;

    cout<<bsum+csum-(cs*bs==flag);

}



int main() {

    int _ = 1;

//    cin >> _;

    while (_--) {

        solve();

    }

    return 0;

}