题面
题意
题解
代码
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int t;
cin >> t;
while (t--) {
ll x, y;
cin >> x >> y;
ll res = 0;
for (ll k = 1; k <= sqrt(x); k++) {
res += max(0ll, min(y, x / k - 1) - k);
}
cout << res << endl;
}
return 0;
}