Test Cases are failing. Please explain the question in detail as well. What I have understood is that we can place a tile either horizontally or vertically. But my code isn’t getting submitted. Please go through it.
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc=new Scanner (System.in);
int t=sc.nextInt();
while (t-->0) {
int n=sc.nextInt();
int m=sc.nextInt();
int cnt=tiling (n,m);
System.out.println (cnt);
}
}
static int tiling (int n, int m) {
if (n==0) {
return 1;
} else if (n<0) {
return 0;
} else {
return tiling (n-1,m) + tiling (n-m,m);
}
}
}


