My issue
Can you please explain me how this problem can be solved using recursion?
I have solved this problem in a simple way!!
My code
import java.util.Scanner;
class Codechef {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
for (int i = 0; i < t; i++) {
long app = sc.nextLong();
long box = sc.nextLong();
if (box == 1) {
System.out.println("NO");
} else if ((app / box) % box == 0) {
System.out.println("NO");
} else {
System.out.println("YES");
}
}
}
}
Learning course: Design and Analysis of Algorithms
Problem Link: https://www.codechef.com/learn/course/kl-daa/KLDAA2400H/problems/DSTAPLS