Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define fo(n) for(int i=0;i<n;i++)
- #define fos(o,n) for(int i=o;i<=n;i++)
- int main(){
- int T;
- cin >> T;
- while( T-- ){
- int a , b , ans , max = -1;
- cin >> a >> b;
- fos( a , b ){
- int now = 0;
- for( int j = 1 ; j <= sqrt( i ) ; ++j ) if( !( i % j ) ) now += 2;
- if( (int)sqrt( i ) * (int)sqrt( i ) == i ) --now;
- if( now > max ) ans = i , max = now;
- }
- printf( "Between %d and %d, %d has a maximum of %d divisors.\n" , a , b , ans , max );
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement