Can you point out what’s wrong in my approach ?
#include<iostream>
using namespace std;
#define mod 10000009
#define ll long long int
int tiling(ll n,ll m,int *dp) {
if(n>=1&& n<m)
return 1;
if(n==m)
return 2;
if(dp[n]!=0) return dp[n];
dp[n] = (tiling(n-1,m,dp)%mod+tiling(n-m,m,dp)%mod)%mod;
return dp[n];
}
int main() {
ll t;
cin>>t;
while(t--) {
ll n,m;
cin>>n>>m;
int dp[n]={0};
cout<<tiling(n,m,dp)<<endl;
}
return 0;
}