intmain(){ int T; cin >> T; int Left, Right; while (T--) { cin >> Left >> Right; int Ans = 0, Node = Left; for (int n = Left; n <= Right; ++n) { int Number = n; int Count = 1; int Max = ceil(sqrt(Right)); int NumberOfDifP = 0; for (int i = 2; i <= Max; ++i) { if (Number % i == 0) { ++NumberOfDifP; int temp = 0; while (Number % i == 0) { Number /= i; ++temp; } Count *= (temp + 1); } } if (NumberOfDifP == 0) { Count = 1; } if (Number != 1) { ++Count; } if (Ans < Count) { Ans = Count; Node = n; } } printf("Between %d and %d, %d has a maximum of %d divisors.\n", Left, Right, Node, Ans); }