the code :
#include
using namespace std;
int main() {
int t,n;
cin>>t;
while(t–)
{
cin>>n;
long a[n+1];
a[0]=1;
a[1]=1;
for(int i=2;i<=n;i++)
{
a[i]=a[i-1] + (i-1)*a[i-2];
// cout<<a[i]<<endl;
}
cout<<a[n]<<endl;
}
return 0;
}
this gives wrong answer for values of n like 84,87 etc. what is the error in this ?