总时间限制:
1000ms
内存限制:
65536kB
描述
Given A, B and C. Find X and Y so that A times X plus B times Y equals to C.
输入
Three positive integer A, B, C (A, B, C <= 100).
输出
Two integers X and Y.
样例输入
4 7 10
样例输出
-1 2
#include<bits/stdc++.h>//Writed by Wangzhimin Date:2022.06.06
using namespace std;
int main()
{
int c,a,b,i,j;
scanf("%d%d%d",&a,&b,&c);
for(i=0;;i++)
{
if((c-b*i)%a==0)
{
cout<<(c-b*i)/a<<" "<<i;
return 0;}
}
}