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

using namespace std;

int main()

{

    int n,a;

    cin>>n>>a;

    if(a>=n%500)

        cout<<"Yes"<< endl;

    else

        cout<<"No"<<endl;

    return 0;

}


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

int main()

{

    int n,A,x;



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



    if(n < 500)

    {

        if(n <= A)

            printf("Yes\n");

        else

            printf("No\n");

    }



    else if(n >= 500)

    {

        x = n % 500;

        if(x <= A)

            printf("Yes\n");

        else

            printf("No\n");

    }



    return 0;

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

using namespace std;

#define nl cout<<'\n';

int main()

{

    long long x,a;

    cin>>x>>a;

    x=x%500;

    if(x<=a)

      cout<<"Yes";

    else

      cout<<"No";

    nl;

    return 0;

}


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

int main()

{

    int n,A,x;



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



    if(n < 500)

    {

        if(n <= A)

            printf("Yes\n");

        else

            printf("No\n");

    }



    else if(n >= 500)

    {

        x = n % 500;

        if(x <= A)

            printf("Yes\n");

        else

            printf("No\n");

    }



    return 0;

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

#include <iostream>

#include<math.h>

#include<string>

#include<iomanip>

#include <numeric>

#include <limits>

using namespace std;

 

int main()

{

int n,a; cin>>n>>a;

if(n-(n/500)*500 <= a) cout<<"Yes";

else cout<<"No";

return 0;

}

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

int main()

{

    int n,A,x;



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



    if(n < 500)

    {

        if(n <= A)

            printf("Yes\n");

        else

            printf("No\n");

    }



    else if(n >= 500)

    {

        x = n % 500;

        if(x <= A)

            printf("Yes\n");

        else

            printf("No\n");

    }



    return 0;

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

#include<iostream>

#include<cstdlib>

#include<cstring>

#include<vector>

#include<string>

#include<cstdio>

#include<cctype>

#include<queue>

#include<stack>

#include<cmath>

#include<ctime>

#include<set>

#include<map>



using namespace std;



int main() {

	int n,a;

	cin>>n>>a;

	cout<<(n%500<=a?"Yes":"No");

	return 0;

}


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

int A,C;

int main()

{

	scanf("%d%d",&A,&C);

	A-=A/500*500;

	if(C>=A) printf("Yes\n");

	else printf("No\n");

	return 0;

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

#include<bits/stdc++.h>

#define fi first

#define sc second

#define pb push_back





using namespace std;

 

 

int N, A;

int main() { 

	

	cin >> N >> A;

	N -= (500 * (N / 500));

	if (N > A) cout << "No\n";

	else cout << "Yes\n";

	return 0;

}

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

int main()

{

    int a,n,i,j,s,r;

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

    if(n<=a)

        printf("Yes\n");

    else

    {

        if(n%500<=a)

            printf("Yes\n");

        else

            printf("No\n");

    }



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

using namespace std;



int main(){

    int n,a;

    cin >> n >> a;

    if ((n % 500) <= a) {

        cout << "Yes" << endl;

    } else {

        cout << "No" << endl;

    }

    

}


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

int main()

{

    int a,n,i,j,s,r;

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

    if(n<=a)

        printf("Yes\n");

    else

    {

        if(n%500<=a)

            printf("Yes\n");

        else

            printf("No\n");

    }



}
// Slower C++ solution:
// Author : MohamedSameh

#include <bits/stdc++.h>

typedef long long ll ;

#define pb push_back

#define f first

#define s second

#define all(v) v.begin(),v.end()

#define rall(v) v.rbegin(),v.rend()

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

void fo (){fflush(stdout);}

using namespace std;



int main ()

{

  int n , m ;

  cin >> n >> m ;

  n%=500 ;

  if (n <= m )

  {

    cout <<"Yes\n";

  }else

  cout <<"No\n"; 

  //cerr << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";

  return 0;

}


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

int main()

{

    int a,n,i,j,s,r;

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

    if(n<=a)

        printf("Yes\n");

    else

    {

        if(n%500<=a)

            printf("Yes\n");

        else

            printf("No\n");

    }



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

using namespace std ;

#define ll long long

inline int D(){

    int t ;

    scanf( "%d" , &t ) ;

    return t ;

}

inline ll LLD(){

    ll t ;

    scanf( "%lld" , &t ) ;

    return t ;

}





//#########################################









int main() {



    int a=D(),b=D();

    if(b>=(a%500)){

        cout<<"Yes";



    } else cout<<"No";





}


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

int main()

{

    int a,n,i,j,s,r;

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

    if(n<=a)

        printf("Yes\n");

    else

    {

        if(n%500<=a)

            printf("Yes\n");

        else

            printf("No\n");

    }



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

using namespace std;

int main()

{

   int n,a,s;

   cin>>n>>a;



   s=n%500;

   if(s<=a)

    cout<<"Yes";

    else cout<<"No";

   return 0;

   }

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

int main()

{

    int a,n,i,j,s,r;

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

    if(n<=a)

        printf("Yes\n");

    else

    {

        if(n%500<=a)

            printf("Yes\n");

        else

            printf("No\n");

    }



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

#include<map>

#include<algorithm>

using namespace std;

typedef pair<int,int> P;

P mt[200];

int dp[1000][201];//hでn個のときのrの最小値

int min(int a,int b){return a<b?a:b;}

int max(int a,int b){return a>b?a:b;}

int main(){

	int n,m;

	int i,j,k;

	while(1){

	scanf("%d",&n);

	if(n==0)return 0;

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

		int a,b;

		scanf("%d %d",&a,&b);

		mt[i]=P(a,b);

	}

	scanf("%d",&m);

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

		int a,b;

		scanf("%d %d",&a,&b);

		mt[n+i]=P(a,b);

	}

	sort(mt,mt+m+n);

	for(i=0;i<1000;i++)for(j=0;j<=m+n;j++)dp[i][j]=1000;

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

		int h=mt[i].first;

		int r=mt[i].second;

		dp[h][1]=min(dp[h][1],r);

		for(j=0;j<h;j++){

			for(k=0;k<m+n;k++){

				if(r>dp[j][k])dp[h][k+1]=min(dp[h][k+1],r);

			}

		}

	}

	int ans=0;

	for(i=0;i<1000;i++)for(j=0;j<=m+n;j++){

		if(dp[i][j]!=1000)ans=max(ans,j);

	}

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

	}

}

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

int dp[200];//iが一番外の最大値

int h[200];

int r[200];

int m,n;

int max(int a,int b){return a>b?a:b;}

int dfs(int x){

	if(dp[x]!=-1)return dp[x];

	int i;

	int ans=1;

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

		if(h[i]<h[x]&&r[i]<r[x])ans=max(ans,dfs(i)+1);

	}

	return dp[x]=ans;

}

int main(){

	while(1){

	scanf("%d",&m);

	if(m==0)return 0;

	int i;

	for(i=0;i<m;i++)scanf("%d %d",&h[i],&r[i]);

	scanf("%d",&n);

	for(i=0;i<n;i++)scanf("%d %d",&h[i+m],&r[i+m]);

	int ans=1;

	for(i=0;i<m+n;i++)dp[i]=-1;

	for(i=0;i<m+n;i++)ans=max(ans,dfs(i));

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

	}

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

#include <vector>



using namespace std;



int main() {

	int n;

	while ( cin >> n, n ) {

		vector<int> h(n), r(n);

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

			cin >> h[i] >> r[i];

		}

		int M; cin >> M;

		h.resize(n+M);

		r.resize(n+M);

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

			cin >> h[n+i] >> r[n+i];

		}

		n += M;



		int m[200][200] = {0};

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

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

				if (h[i] < h[j] && r[i] < r[j]) {

					m[i][j] = -1;

				}

			}

		}

		int ans = 0;

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

			if (m[i][k] && m[k][j]) {

				m[i][j] = min(m[i][j], m[i][k] + m[k][j]);

			}

			ans = min(ans, m[i][j]);

		}

		cout << (-ans + 1) << endl;

	}

}

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



using namespace std;



typedef long long ll;

typedef unsigned long long ull;

typedef long double ld;

typedef pair<ll, ll> P;



#define EACH(i,a) for (auto& i : a)

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

#define RFOR(i,a,b) for (ll i=(b)-1;i>=(a);i--)

#define REP(i,n) for (ll i=0;i<(n);i++)

#define RREP(i,n) for (ll i=(n)-1;i>=0;i--)

#define debug(x) cout<<#x<<": "<<x<<endl

#define pb push_back

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



const ll linf = 1e18;

const int inf = 1e9;

const double eps = 1e-12;

const double pi = acos(-1);



template<typename T>

istream& operator>>(istream& is, vector<T>& vec) {

	EACH(x,vec) is >> x;

	return is;

}

/*

template<class... T>

ostream& operator<<(ostream& os, tuple<T...>& t) {

	for (size_t i = 0; i < tuple_size< tuple<T...> >::value; ++i) {

		if (i) os << " ";

		os << get<0>(t);

	}

	return os;

}

*/

template<typename T>

ostream& operator<<(ostream& os, vector<T>& vec) {

	REP(i,vec.size()) {

		if (i) os << " ";

		os << vec[i];

	}

	return os;

}

template<typename T>

ostream& operator<<(ostream& os, vector< vector<T> >& vec) {

	REP(i,vec.size()) {

		if (i) os << endl;

		os << vec[i];

	}

	return os;

}



int main() {

	std::ios::sync_with_stdio(false);

	std::cin.tie(0);

	int N;

	while ( cin >> N, N ) {

		vector<P> v;

		REP(i, N) {

			int h, r; cin >> h >> r;

			v.pb( P(h, r) );

		}

		int M; cin >> M;

		REP(i, M) {

			int h, r; cin >> h >> r;

			v.pb( P(h, r) );

		}

		sort( ALL(v) );

		N += M;

		vector< vector<int> > dp(N+1, vector<int>(N+1, -1)); dp[0][0] = 0;

		REP(i, N) {

			REP(j, N+1) {

				if (dp[i][j] < 0) continue;

				dp[i+1][j] = max(dp[i+1][j], dp[i][j]);

				if (j == 0 || (v[j-1].first < v[i].first && v[j-1].second < v[i].second)) {

					dp[i+1][i+1] = max(dp[i+1][i+1], dp[i][j]+1);

				}

			}

		}

		int ans = -1;

		REP(i, N+1) ans = max(ans, dp[N][i]);

		cout << ans << endl;

	}

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

using namespace std;

int main()

{

ios_base::sync_with_stdio(false);

int n;

cin >> n;

long long a[2*n+1];

for(int i = 0; i < 2*n; i++)cin >> a[i];

sort(a,a+2*n);

long long sum = 0;

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

{

sum+=a[i];

}

cout << sum;

return 0;

}

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

#include<algorithm>

using namespace std;

int n,a[2001],sum=0;



inline void init() {

	scanf("%d",&n);

	n*=2;

	for (int i=1;i<=n;i++) scanf("%d",&a[i]);

	sort(a+1,a+n+1);

}



inline void work() {

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

		if (i%2==1) 

			sum+=a[i]; 

}



int main() {

	init();

	work();

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

	return 0;

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

using namespace std;



const int N = 211;



int a[N];



int main() {

	ios :: sync_with_stdio(0);

	int n; cin >> n;

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

		cin >> a[i];

	sort(a, a + 2 * n);

	int ans = 0;

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

		ans += a[i];

	cout << ans << '\n';

}

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

#include<algorithm>

using namespace std;

int n,a[2001],sum=0;



inline void init() {

	scanf("%d",&n);

	n*=2;

	for (int i=1;i<=n;i++) scanf("%d",&a[i]);

	sort(a+1,a+n+1);

}



inline void work() {

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

		if (i%2==1) 

			sum+=a[i]; 

}



int main() {

	init();

	work();

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

	return 0;

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

using namespace std;

int main()

{

ios_base::sync_with_stdio(false);

int n;

cin >> n;

long long a[2*n+1];

for(int i = 0; i < 2*n; i++)cin >> a[i];

sort(a,a+2*n);

long long sum = 0;

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

{

sum+=a[i];

}

cout << sum;

return 0;

}

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

#include<string.h>

#include<algorithm>

using namespace std;

int n,s[1010];

int main(){

	scanf("%d",&n); n<<=1;

	for(int i=1;i<=n;++i) scanf("%d",s+i);

	sort(s+1,s+1+n);

	for(int i=1;i<=n;i+=2) *s+=min(s[i],s[i+1]);

	printf("%d\n",*s);

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

using namespace std;



const int N = 211;



int a[N];



int main() {

	ios :: sync_with_stdio(0);

	int n; cin >> n;

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

		cin >> a[i];

	sort(a, a + 2 * n);

	int ans = 0;

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

		ans += a[i];

	cout << ans << '\n';

}

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

#include<string.h>

#include<algorithm>

using namespace std;

int n,s[1010];

int main(){

	scanf("%d",&n); n<<=1;

	for(int i=1;i<=n;++i) scanf("%d",s+i);

	sort(s+1,s+1+n);

	for(int i=1;i<=n;i+=2) *s+=min(s[i],s[i+1]);

	printf("%d\n",*s);

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

using namespace std;

int n,a[210],s=0;

int main()

{

	cin>>n;

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

	  cin>>a[i];

	sort(a+1,a+2*n+1);

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

	  s+=a[i];

	cout<<s;

    return 0;

}

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

#include<string.h>

#include<algorithm>

using namespace std;

int n,s[1010];

int main(){

	scanf("%d",&n); n<<=1;

	for(int i=1;i<=n;++i) scanf("%d",s+i);

	sort(s+1,s+1+n);

	for(int i=1;i<=n;i+=2) *s+=min(s[i],s[i+1]);

	printf("%d\n",*s);

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



using namespace std;



const int N = 1234;

long long a[N] , ans , n;



int main()

{

	cin >> n;

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

		cin >> a[i];

	sort(a , a + (2 * n));

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

	{

		if((i + 1) % 2)

		{

			ans += a[i];

		}

	}

	cout << ans;

}

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

#include<string.h>

#include<algorithm>

using namespace std;

int n,s[1010];

int main(){

	scanf("%d",&n); n<<=1;

	for(int i=1;i<=n;++i) scanf("%d",s+i);

	sort(s+1,s+1+n);

	for(int i=1;i<=n;i+=2) *s+=min(s[i],s[i+1]);

	printf("%d\n",*s);

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

using namespace std;

int main()

{

ios_base::sync_with_stdio(false);

int n;

cin >> n;

long long a[2*n+1];

for(int i = 0; i < 2*n; i++)cin >> a[i];

sort(a,a+2*n);

long long sum = 0;

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

{

sum+=a[i];

}

cout << sum;

return 0;

}

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

#include<algorithm>

using namespace std;

int aa[230];

main()

{

	int n;

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

	{

		int i;

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

		{

			scanf("%d",&aa[i]);

		}

		sort(aa,aa+2*n);

		int min,num=0;

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

		{

			min=aa[i]<aa[i+1]?aa[i]:aa[i+1];

			num+=min;

		}

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

	}

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

using namespace std;



const int N = 211;



int a[N];



int main() {

	ios :: sync_with_stdio(0);

	int n; cin >> n;

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

		cin >> a[i];

	sort(a, a + 2 * n);

	int ans = 0;

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

		ans += a[i];

	cout << ans << '\n';

}

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

#include<algorithm>

using namespace std;

int aa[230];

main()

{

	int n;

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

	{

		int i;

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

		{

			scanf("%d",&aa[i]);

		}

		sort(aa,aa+2*n);

		int min,num=0;

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

		{

			min=aa[i]<aa[i+1]?aa[i]:aa[i+1];

			num+=min;

		}

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

	}

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

using namespace std;

int n,a[210],s=0;

int main()

{

	cin>>n;

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

	  cin>>a[i];

	sort(a+1,a+2*n+1);

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

	  s+=a[i];

	cout<<s;

    return 0;

}

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

#include<algorithm>

using namespace std;

int aa[230];

main()

{

	int n;

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

	{

		int i;

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

		{

			scanf("%d",&aa[i]);

		}

		sort(aa,aa+2*n);

		int min,num=0;

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

		{

			min=aa[i]<aa[i+1]?aa[i]:aa[i+1];

			num+=min;

		}

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

	}

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



using namespace std;



const int N = 1234;

long long a[N] , ans , n;



int main()

{

	cin >> n;

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

		cin >> a[i];

	sort(a , a + (2 * n));

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

	{

		if((i + 1) % 2)

		{

			ans += a[i];

		}

	}

	cout << ans;

}

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

#include<algorithm>

using namespace std;

int aa[230];

main()

{

	int n;

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

	{

		int i;

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

		{

			scanf("%d",&aa[i]);

		}

		sort(aa,aa+2*n);

		int min,num=0;

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

		{

			min=aa[i]<aa[i+1]?aa[i]:aa[i+1];

			num+=min;

		}

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

	}

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

#include<algorithm>

#include<iostream>



using namespace std;

int L[205];

int main()

{

	int N;

	int sum=0;

	int min;

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

	{

		for(int i=0;i<2*N;i++)

		{

			cin>>L[i];

		}

		sort(L,L+2*N);

		

		for(int j=0;j<2*N;j=j+2)

		{

			min=L[j]<L[j+1] ? L[j] : L[j+1];

			sum=sum+min;

		}

		cout<<sum<<endl;

	}

} 

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

#include<algorithm>

using namespace std;

int aa[230];

main()

{

	int n;

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

	{

		int i;

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

		{

			scanf("%d",&aa[i]);

		}

		sort(aa,aa+2*n);

		int min,num=0;

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

		{

			min=aa[i]<aa[i+1]?aa[i]:aa[i+1];

			num+=min;

		}

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

	}

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

#include<algorithm>

using namespace std;

int a[105];

int main(){

	int n,ans;

	cin>>n;

	for (int i=1;i<=n*2;i++)cin>>a[i];

	sort(a+1,a+n*2+1);

	ans=0;

	for (int i=1;i<=n*2-1;i+=2) ans+=a[i];

	cout<<ans<<endl;

	return 0;

}

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

#include<algorithm>

using namespace std;

int aa[230];

main()

{

	int n;

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

	{

		int i;

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

		{

			scanf("%d",&aa[i]);

		}

		sort(aa,aa+2*n);

		int min,num=0;

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

		{

			min=aa[i]<aa[i+1]?aa[i]:aa[i+1];

			num+=min;

		}

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

	}

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

#include<cstdio>

#include<algorithm>

using namespace std;

#define MAXN 200

int n;

int L[MAXN+5],ans=0;

int main()

{

	scanf("%d",&n);

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

		scanf("%d",&L[i]);

	sort(L+1,L+n*2+1);

	for(int i=1;i<=2*n;i+=2)ans+=L[i];

	printf("%d",ans);//

}

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

#include<algorithm>

using namespace std;

   int n;

   int a[205];

   int main()

   {

   while(scanf("%d",&n)!=EOF)

      {

      n=n*2;	

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

         scanf("%d",&a[i]);

      sort(a,a+n); 

      int sum=0;

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

	     {

	     sum+=a[i];

		 }

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

      }	

   }
// Slower C++ solution:
//in the name of Allah ;

#include<bits/stdc++.h>

using namespace std ;

int arr[1000] ;

int main ()

{

	int n , ans = 0;

	cin >> n ;

	n *= 2 ; 

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

		cin >> arr[i];

	sort ( arr, arr+n ) ;

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

		ans += min ( arr[i] , arr[i+1] ) ;

	cout << ans << endl;

}

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

#include<algorithm>

using namespace std;

   int n;

   int a[205];

   int main()

   {

   while(scanf("%d",&n)!=EOF)

      {

      n=n*2;	

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

         scanf("%d",&a[i]);

      sort(a,a+n); 

      int sum=0;

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

	     {

	     sum+=a[i];

		 }

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

      }	

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

using namespace std;

const int Maxn=400;

int a[Maxn],maj,n;

int main(){

	cin>>n;

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

		cin>>a[i];

	}

	sort(a,a+(2*n));

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

		maj+=a[i];

	}

	cout<<maj;

}


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

#include<algorithm>

using namespace std;

   int n;

   int a[205];

   int main()

   {

   while(scanf("%d",&n)!=EOF)

      {

      n=n*2;	

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

         scanf("%d",&a[i]);

      sort(a,a+n); 

      int sum=0;

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

	     {

	     sum+=a[i];

		 }

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

      }	

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

#include<cstdio>

#include<algorithm>

using namespace std;

#define MAXN 200

int n;

int L[MAXN+5],ans=0;

int main()

{

	scanf("%d",&n);

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

		scanf("%d",&L[i]);

	sort(L+1,L+n*2+1);

	for(int i=1;i<=2*n;i+=2)ans+=L[i];

	printf("%d",ans);//

}

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

#include<algorithm>

using namespace std;

int main()

{   int n,s=0,i;

 	scanf("%d",&n);

	int a[2*n];

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

	scanf("%d",&a[i]);

	  sort(a,a+n+n);

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

		if(i%2==0)

		s+=a[i];

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

}
// Slower C++ solution:
//in the name of Allah ;

#include<bits/stdc++.h>

using namespace std ;

int arr[1000] ;

int main ()

{

	int n , ans = 0;

	cin >> n ;

	n *= 2 ; 

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

		cin >> arr[i];

	sort ( arr, arr+n ) ;

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

		ans += min ( arr[i] , arr[i+1] ) ;

	cout << ans << endl;

}

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

#include<algorithm>

using namespace std;

int main()

{   int n,s=0,i;

 	scanf("%d",&n);

	int a[2*n];

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

	scanf("%d",&a[i]);

	  sort(a,a+n+n);

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

		if(i%2==0)

		s+=a[i];

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

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

using namespace std;

const int Maxn=400;

int a[Maxn],maj,n;

int main(){

	cin>>n;

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

		cin>>a[i];

	}

	sort(a,a+(2*n));

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

		maj+=a[i];

	}

	cout<<maj;

}


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

#include<algorithm>

using namespace std;

int main()

{   int n,s=0,i;

 	scanf("%d",&n);

	int a[2*n];

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

	scanf("%d",&a[i]);

	  sort(a,a+n+n);

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

		if(i%2==0)

		s+=a[i];

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

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

#include<cstdio>

#include<algorithm>

using namespace std;

#define MAXN 200

int n;

int L[MAXN+5],ans=0;

int main()

{

	scanf("%d",&n);

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

		scanf("%d",&L[i]);

	sort(L+1,L+n*2+1);

	for(int i=1;i<=2*n;i+=2)ans+=L[i];

	printf("%d",ans);//

}

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

#include<algorithm>

using namespace std;

int main()

{

	int n;

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

  {

	int a[2*n];

	int i;

	for(i=0;i<=2*n-1;i++)

	  scanf("%d",&a[i]);

	sort(a,a+2*n);

	int sum=0;

	for(i=0;i<=2*n-1;i+=2)

	sum+=a[i];

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

  }

	return 0;

}