import java.util.*;
public class Main {
public static long bottomToTop(int n, int m) {
long dp[] = new long[n+1];
dp[0] = 1;
for(int i=1; i<=n; i++) {
dp[i] = dp[i-1];
if(i-m>=0) dp[i] += dp[i-m];
}
return dp[n];
}
public static void main(String[] args) {
//System.out.println();
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t–>0) {
int n = sc.nextInt();
int m = sc.nextInt();
//System.out.println(topToBottom(n,m, new long[n+1]));
System.out.println(bottomToTop(n,m));
}
}
}
Test cases are not getting passed for this code. What might be the problem?