#include
#include
using namespace std;
int main()
{
int a[100];
int b[100];
int c[100];
int n;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>a[i];
}
for(int i=0;i<n;i++)
{
cin>>b[i];
}
for(int i=0;i<n;i++)
{
c[i]=a[i];
}
int size=n+n;
for(int i=0,j=n;i<n or j<size;i++,j++)
{
c[j]=b[i];
}
for(int i=0;i<size-1;i++)
{
int min_index=i;
for(int j=i;j<size;j++)
{
if(c[j]<c[min_index])
{
min_index=j;
}
}
swap(c[i],c[min_index]);
}
int s=0;
int e=size-1;
int m;
m=(s+e)/2;
cout<<c[m];
return 0;
}
i have used selection sort for sorting of the array,
when i was using sort function for sorting the array it is not giving the sorted array