1 #include <iostream> 2 #include <sstream> 3 #include <string> 4 #include <cmath> 5 #include <algorithm> 6 #include <vector> 7 using namespace std; 8 9 #define GI ({int _t; scanf("%d", &_t); _t;}) 10 #define FOR(i, a, b) for (long long int i=a; i<b; i++) 11 #define REP(i, a) FOR(i, 0, a) 12 13 int main() { 14 int cnt = GI; 15 while (cnt--) { 16 long long int res = -1, max = -1; 17 long long int a, b; 18 cin >> a >> b; 19 if (a==1 && b==1) { 20 printf("Between 1 and 1, 1 has a maximum of 1 divisors.\n"); 21 continue; 22 } 23 FOR(i, a, b+1) { 24 int t = 0; 25 FOR(j, 1, sqrt(i)) { 26 if (i%j==0) t++; 27 } 28 t*=2; 29 if (sqrt(i)*sqrt(i) == i) t++; 30 if (t>max) { 31 res = i; max = t; 32 } 33 } 34 printf("Between %lld and %lld, %lld has a maximum of %lld divisors.\n", a, b, res, max); 35 } 36 return 0; 37 }