/** * @brief Codeforces Round #275 (div. 2) a * @file a.cpp * @author Face codes * @created 2014/12/10 15:35 * @edited 2014/12/10 15:35 * @type brute * */#include <iostream># include <fstream> #include <cstdlib> #include <stack> #include <string > #include <cstring>using namespace std; #define &NBSP;MAX (a, b) ((a) > (b) ? (a) : (b)) #define &NBSP;MIN (A, b) ((a) > (b) ? (b) : (a)) #define &NBSP;ABS (a) ((a) > 0 ? (a) : (0 - (a))) #define &NBSP;CLR (VEC) memset (vec, 0, sizeof (VEC)) #ifdef DEBUGifstream in;ofstream out; #define Cin in#define cout out#else #define cin cin#define cout cout#endiftypedef long long int ll;ll l, r, mid, lft, rht;ll division;int search;int main (void) { ios_base::sync_with_stdio (0); #ifdef debug cin.open ("./in", ios::in); cout.open (". Out", ios::out); #endif Cin >> l >> r; if (r - l < 2) { COUT << " -1\n"; return 0; } for ( mid = l + 1; mid < r; mid++) for (lft = l; lft < mid; lft++) for (Rht = r; rht > mid; rht--) { search = 0; for (division = 2; division <= 50 && division <= min (Lft, mid); division++) { if (lft%division == 0 && mid%division == 0) { search = 1; break; } } if ( 1 == search) { continue; } search = 0; for ( Division = 2; division <= 50 && division <= min (Rht , mid); division++) { if (rht%division == 0 && mid%division == 0) { search = 1; break; } } if (&NBSP;1&NBSP;==&NBSp;search) { continue; } search = 0; for (division = 2; division <= 50 && Division <= min (Lft, rht); division++) { if (rht% division == 0 && lft%division == 0) { search = 1; break; } } if ( 1 == search) { COUT << lft << " " << mid << " " << rht << "\ N "; return 0; } } COUT << " -1\n"; return 0;}
Codeforces Round #275 (Div. 2) A