题目描述:
给定 n, m ,问是否存在两个不同的数 x, y 使得 1 ≤ x < y ≤ m 且 n mod x = n mod y 。
代码:
java
package lanqiao;
import java.math.BigInteger;
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();
boolean tf = false;
for(int x = 1;x <= m;x ++)
{
for(int y = 1;y < x;y ++){
if(x == y || n % x != n % y){
continue;
}
tf = true;
break;
}
if(tf)
{
break;
}
}
if(tf)
{
System.out.println("Yes");
continue;
}
System.out.println("No");
}
}
}