#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<vector>
#include<cmath>
#include<stdlib.h>
#include<iomanip>
#include<list>
#include<deque>
#include<map>
#include <stdio.h>
#include <queue>
#define maxn 10000+5
#define ull unsigned long long
#define ll long long
#define reP(i,n) for(i=1;i<=n;i++)
#define rep(i,n) for(i=0;i<n;i++)
#define cle(a) memset(a,0,sizeof(a))
#define mod 90001
#define PI 3.141592657
#define INF 1<<30
const ull inf = 1LL << 61;
const double eps=1e-5;
using namespace std;
bool cmp(int a,int b){
return a>b;
}
ll gcd(ll a,ll b)///36 24
{
return b==0?a:gcd(b,a% b);
}
bool judge(ll a,ll b)
{
if(gcd(a,b)==1)return true;
else return false;
}
int main()
{
//freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
ll a,b;
cin>>a>>b;
for(ll i=a;i<=b;i++)
{
for(ll j=i+1;j<=b;j++)
{
for(ll k=j+1;k<=b;k++)
if(judge(i,j)&&judge(j,k)&&(!judge(i,k))){cout<<i<<" "<<j<<" "<<k<<endl;return 0;}
}
}
cout<<-1<<endl;
return 0;
}
CF 275A. Counterexample
最新推荐文章于 2021-07-24 19:01:43 发布
http://codeforces.com/contest/483/problem/A
题目大意 给出区间 x~y 然我们举出在区间中的三个数 a b c 满足 ab,bc互质 ac不互质,如果没有输出-1。暴力枚举就行
最坏50*49*48。~~