What is wrong with this code?

#include
using namespace std;
int count(int n)
{

if(n<=2)
{
	return n;
}
return count(n-1)+n-1*count(n-2);

}
int main() {
int t;
cin>>t;
while(t–)
{
int x=0;
int n;
cin>>n;
x=count(n);
cout<<x<<endl;
}
return 0;
}

@mayank10 I don’t think there is something wrong in the logic but it may give wrong answer depending upon the values of n, so prefer to use long long int before submitting.

https://ide.codingblocks.com/s/230972 what is the mistake in code getting wrong answer

@mayank10
Use long long instead of int in dp