No test case passed due to MLE

code:
#include
using namespace std;
void merge(long long int *a,long long int *b,long long int *c,long long int s,long long int e){
long long int m=(s+e)/2;
long long int i=s;
long long int j=m+1;
long long int k=s;
while(i<=m and j<=e){
if(b[i]<=c[j]){
a[k++]=b[i++];
}
else{
a[k++]=c[j++];
}
}
while(i<=m){
a[k++]=b[i++];
}
while(j<=e){
a[k++]=c[j++];
}
}
void mergesort(long long int a,long long int s,long long int e){
//base case
if(s>=e){
return;
}
long long int m=(s+e)/2;
//recursive
//1.divide
long long int b[100],c[100];
for(int i=s;i<=m;i++){
b[i]=a[i];
}
for(int i=m+1;i<=e;i++){
c[i]=a[i];
}
//2.sort
mergesort(b,s,m);
mergesort(c,m+1,e);
//3.merge
merge(a,b,c,s,e);
}
int main(){
long long int a[2
10000];
long long int n;
cin>>n;
for(int i=0;i<n;i++){
cin>>a[i];
}

mergesort(a,0,n-1);
for(int i=0;i<n;i++){
    cout<<a[i]<<" ";
}
cout<<endl;

}

hi @anshita_1312 updated https://ide.codingblocks.com/s/667730

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.