question:

https://www.codechef.com/QFUN2020/problems/CHEFCAKE

```
#include<iostream>
#include<math.h>
using namespace std;
long long int fact(long long int num)
{
if(num==2)
{
return 2;
}
return fact(num-1)*num;
}
int main()
{
int t;
cin>>t;
while(t--)
{
long long int i,n,temp,sum=0,ans=0;
cin>>n;
long long int a[n];
for(i=0;i<n;i++)
{
cin>>a[i];
sum=sum+a[i];
}
temp=fact(n-1)*(sum);
ans=((pow(10,n))-1)/9;
ans=ans*temp;
cout<<ans<<endl;
}
}
it is showing tle
```