Advertisement
BoxerTC

CounterExample

Oct 26th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. #define sc( x ) scanf( "%d" , &x )
  5. #define REP( i , n ) for( int i = 0 ; i < n ; ++i )
  6. #define clr( t , val ) memset( t , val , sizeof( t ) )
  7.  
  8. #define pb push_back
  9. #define all( v ) v.begin() , v.end()
  10. #define SZ( v ) ((int)(v).size())
  11.  
  12. #define mp make_pair
  13. #define fi first
  14. #define se second
  15.  
  16. typedef long long ll;
  17.  
  18. int main(){
  19.     ll L , R;
  20.     while( cin >> L >> R ){
  21.         bool found = 0;
  22.         for( ll a = L ; !found && a < R ; ++a )
  23.             for( ll b = a + 1 ; !found && b < R ; ++b )
  24.                 for( ll c = b + 1 ; !found && c <= R ; ++ c ){
  25.                     if( __gcd( a , b ) == 1 && __gcd( b , c ) == 1 && __gcd( a , c ) != 1 ) {
  26.                         cout << a << ' ' << b << ' ' << c << '\n';
  27.                         found = 1;
  28.                         break;
  29.                     }
  30.                 }
  31.         if( !found ) cout << "-1" << '\n';
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement