AcWing 3545. 寻找奇特的数
原题链接
简单
作者:
Yeahhh
,
2021-05-22 13:42:48
,
所有人可见
,
阅读 408
import java.util.Scanner;
/**
* @author: yeah
* 找不大于n约数即可
*/
public class Main {
static int t, n, m;
static int getCnt(int x) {
int res = 0;
for (int i = 1; i <= x / i; i++) {
if (x % i == 0 && i <= n && x / i <= n) {
if (i != x / i) res += 2;
else res++;
}
}
return res;
}
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
t = in.nextInt();
while (t-- > 0) {
n = in.nextInt();
m = in.nextInt();
System.out.println(getCnt(m));
}
}
}