What is the problem(tilling problem)

import java.util.Scanner;

public class Main {

static Scanner scn = new Scanner(System.in);

public static void main(String[] args) {
	int z = scn.nextInt();
	while (z != 0) {
		int n = scn.nextInt();
		int m = scn.nextInt();
		int[] dp = new int[n + 1];
		for (int i = 1; i <= n; i++)

		{
			if (i < m)
				dp[i] = 1;

			else if (i == m)
				dp[i] = 2;
			else
				dp[i] = dp[i - 1] + dp[i - m];
		}
		System.out.println(dp[n]);
		z--;
	}
}

}

Print answer for every test case in a new line modulo 10^9+7 .
use modulo

I have no idea how to use that can u help me with it

The reason of taking Mod is to prevent integer overflows. you an refer to this article here to lear more on this

corrected code: