#include using namespace std; typedef long long ll; typedef pair p_ll; template void debug(T itr1, T itr2) { auto now = itr1; while(now=0; i--) #define popcount __builtin_popcount const ll LLINF = pow(2,61)-1; const ll INF = pow(2,30)-1; ll gcd(ll a, ll b) { if (a> T; ll MA = 5*pow(10,5)+10; vector yaku(MA,1); rep(i,MA) { ll ti = i; for (ll x=2; x*x<=ti; x++) { if (ti%x==0) { ll cnt = 1; while (ti%x==0) { cnt++; ti/=x; } yaku[i] *= cnt; } } if (ti!=1) yaku[i] *= 2; } // debug(all(yaku)); vector rui(MA+1); rep(i,MA) rui[i+1] = rui[i] + (yaku[i]>=5); // debug(all(rui)); rep(_,T) { ll P, L, R; cin >> P >> L >> R; L -= P; R -= P; ll result = 0; if (L<=0&&R<=0) result = rui[-1*L+1] - rui[-1*R]; else if (L<=0) result += rui[-1*L+1] + rui[R+1] + 1; else result = rui[R+1] - rui[L]; cout << result << endl; } return 0; }