Tiling 2 dp (cant find error in code)

#include
#include<math.h>
using namespace std;

int count[100000];
int tiling_prob(int n,int m){

//base condition
if(n<m){
       return count[n]=1;
}
else if(n==m){
    return count[n]=2;
}

//recursion ans dp
if(count[n]!=-1)
    return count[n];
else
    return (count[n]= (tiling_prob(n-1,m) + tiling_prob(n-m,m)));

}

int main() {

int t;
cin>>t;
while(t--){

int n,m;
cin>>n>>m;

for(int i=0;i<100000;i++){
    count[i]=-1;
}

long long int t=(tiling_prob(n,m));
long long int p=(pow(10,9)+7);
t=t%p;
cout<<t<<endl;
}

}

Hi Siddharth,
You should use long long int datatype for your code as the answer value is very likely to exceed the range of int. Your dp array and your function return type were given as int which will definitely give you a wrong answer for large values.
Also you should take the MOD in the recursive function while doing the calculations and not just for the final answer .
Here’s your updated code - https://ide.codingblocks.com/s/97239