#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
using namespace std;
typedef long long LL;
const int N = 1e5;
int n,m;
int work(int n,int m){
int res = 0;
for(int i = 1;i <= n;++i){
if(m % i == 0 && m / i <= n) res++;
}
return res;
}
int main(){
int T;
scanf("%d",&T);
for(int i = 0;i < T;++i){
scanf("%d%d",&n,&m);
printf("%d\n",work(n,m));
}
return 0;
}