sunny2014 @ 2024-03-27 21:02:01
#include<bits/stdc++.h>
using namespace std;
int b[15];
void g(int x){
b[x%10] = 1;
b[x/10%10] = 1;
b[x/100] = 1;
}
bool ch(int x,int y,int z){
memset(b,0,sizeof(b));
if(y>999||z>999) return 0;
g(x);
g(y);
g(z);
for(int i=1;i<=9;i++){
if(!b[i]) return 0;
}
return 1;
}
int main(){
long long A,B,C,x,y,z,t=0;
cin>>A>>B>>C;
for(x=123;x<=987;x++){
if(x*B%A||x*C%A) continue;
y = x*B/A;
z = x*C/A;
if(ch(x,y,z)){
printf("%lld %lld %lld\n",x,y,z);
t++;
}
}
if(!t) cout<<"No!!!";
return 0;
}
by BTree @ 2024-03-31 17:05:12
A不能为0