#include int a[1000]; int b[1000]; void copy(int temp[],int a[],int l,int h); void merge(int a[],int n,int temp[],int l1,int h1,int l2,int h2); void sort(int a[],int n,int l,int h) { if(l!=h){ int temp[n]; int mid=l+(h-l)/2; sort(a,n,l,mid); sort(a,n,mid+1,h); merge(a,n,temp,l,mid,mid+1,h); copy(temp,a,l,h); } } void merge(int a[],int n,int temp[],int l1,int h1,int l2,int h2) { int i,j,k; for(i=l1,j=l2,k=l1;((i<=h1)&&(j<=h2));k++) { if(a[i]>a[j]) {temp[k]=a[j]; j++;} else { temp[k]=a[i]; i++; } } for(;i<=h1;i++) { temp[k]=a[i]; k++; } for(;j<=h2;j++) { temp[k]=a[j]; k++; } } void copy(int temp[],int a[],int l,int h) { int i; for(i=l;i<=h;i++) { a[i]=temp[i]; } } int main() { int n; scanf("%d",&n); int i; for(i=0;i