AcWing 3545. 寻找奇特的数
原题链接
简单
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const int N = 1e6 + 10;
int t, n, m, k, l, r, op, x, y, cnt;
int f[N];
void solve() {
cin >> t;
while (t--) {
cnt = 0;
cin >> n >> m;
x = min(n, (int)sqrt(m));
for (int i = 1; i <= x; i++) {
if (m % i == 0 && m / i <= n) {
cnt++;
cnt += i != m / i;
}
}
cout << cnt << "\n";
}
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
solve();
return 0;
}