#include using namespace std; #define MOD 1000000007 #define MOD2 998244353 #define rep(i,n) for (int i = 0; i < (int)(n); i++) #define reps(i,s,n) for (int64_t i = (int64_t)(s); i < (int64_t)(n); i++) #define repit(i,C) for (auto i = (C).begin(); i != (C).end(); i++) #define pr(a) cout << a #define prl(a) cout << (a) << endl #define prld(a) cout << setprecision(15)<< (a) << endl #define allrange(a) a.begin(),a.end() /* divisor(n) 入力:整数 n 出力:nのすべての約数 計算量:O(√n) */ vector divisor(int64_t n) { vector ret; for (int64_t i = 1; i * i <= n; i++) { if (n % i == 0) { ret.push_back(i); if (i * i != n) ret.push_back(n / i); } } sort(ret.begin(), ret.end()); // 昇順に並べる return ret; } int main(){ int T; cin >> T; rep(i,T){ int64_t p,l,r; cin >> p >> l >> r; int ct = 0; reps(k,l,r+1) { auto d = divisor(abs(k-p)); if(d.size()>=5) ct++; } prl(ct); } }