#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main(){
int m,x,y;
cin>>m>>x>>y;
int a,b;
float c;
int xy=0;
//测试点4,丙可以不是整数,要用float
for(a=98;a>9;a--){
xy=0;
b=a%10*10+a/10;
if(a==b){
a--;
b=a%10*10+a/10;
}
int cha=abs(a-b);
c=cha*1.0/x;
if(c*y==b){
xy=1;
break;
}
}
if(xy==0){
cout<<"No Solution"<<endl;
}else{
cout<<a<<" ";
if(a>m){
cout<<"Cong ";
}else if(a==m){
cout<<"Ping ";
}else{
cout<<"Gai ";
}
if(b>m){
cout<<"Cong ";
}else if(b==m){
cout<<"Ping ";
}else{
cout<<"Gai ";
}
if(c>m){
cout<<"Cong";
}else if(c==m){
cout<<"Ping";
}else{
cout<<"Gai";
}
}
}
1088 三人行 c++
最新推荐文章于 2025-09-01 22:49:35 发布