qshboy @ 2021-03-29 12:14:32
#include<bits/stdc++.h>
using namespace std;
int main(void)
{
int p[11]={0};
int count=0,flag=0;
int a,b,c,i,j,k,f,t,r;
cin>>a>>b>>c;
for(i=1;i<=9;i++){
for(j=1;j<=9;j++){
for(k=1;k<=9;k++){
flag=0;
for(f=1;f<10;f++){
p[f]=0;
}
p[i]=1;
p[j]=1;
p[k]=1;
t=b*(i*100+j*10+k)/a;
r=c*(i*100+j*10+k)/a;
p[t%10]=1;
p[t/10%10]=1;
p[t/100]=1;
p[r%10]=1;
p[r/10%10]=1;
p[r/100]=1;
for(f=1;f<10;f++){
if(p[f]==0){
flag=1;
break;
}
}
f=i*100+j*10+k;
if(flag!=1){
if(count!=0)cout<<endl;
cout<<f<<" "<<t<<" "<<r;
count++;
}
}
}
}
if(!count){
cout<<"No!!!";
}
return 0;
}