Why they are not accepting my code

Tiling problem - 2-

import java.util.*;
public class Main {
public static void main(String args[]) {

                  Scanner sc=new Scanner(System.in);

                  int T=sc.nextInt();

                  for(int i=0;i<T;i++){

                             System.out.println("enter the no.s - ");


                             int n=sc.nextInt();
                             int m=sc.nextInt();

                             System.out.println(combination(n,m));



       }


}



       public static int combination(int n,int m){

                  int[] count =new int[n+1];
                  count[0]=0;


                  for(int i=1;i<=n;i++){

                             if(i<m  || i==1){
                                        count[i]=1;
                             }else if(i>m){
                                        count[i] = count[i-1] + count[i-m];
                             }else{
                                        count[i]=2;
                             }
                  }
                  return count[n];
       }

}

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

.
use modulo

what is modulo?? how to use it

what is modulo?? how to use its

In most of the programming competitions, we are required to answer the result in 10^9+7 modulo. The reason behind this is, if problem constraints are large integers, only efficient algorithms can solve them in allowed limited time

you can see this

read more about modulo here .its a very useful concept

if this solves your doubt please mark it as resolved :slight_smile: