#include#include #include using namespace std; typedef long long LL; LL p[]= {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79}; LL s[5050]; void solve() { memset(s,0,sizeof(s)); s[1]=1; for(int i=2; i<=5000; i++) { int q=i; s[i]=1; for(int j=0; p[j]*p[j]<=q; j++) { int t=1; while(q%p[j]==0) { q/=p[j]; t++; } s[i]*=t; } if(q!=1) s[i]*=2; } } int main() { int t,m,n; cin>>t; solve(); while(t--) { cin>>m>>n; int i,l=0; for(i=m; i<=n; i++) if(s[i]>s[l]) l=i; cout<