AC

野鸡大学叫兽  •  11个月前


include <bits/stdc++.h> using namespace std; int main () {

int a,b,c,flag=0;
cin>>a>>b>>c;
int x=1,y=1;
for(int x=1;x<=3000;x++)
{
	for(int y=1;y<=2000;y++)
	{
		if(a*x+b*y==c)
		{
			cout<<x<<" "<<y<<endl;
			flag++;
		}
	}
}
if(flag==0)
	cout<<"-1";
return 0;

}


评论:

请先登录,才能进行评论