前面忘记修改gcd,一直求不出来。。。套套模板轻松水,,
#include "string"
#include "iostream"
#include "cstdio"
#include "cmath"
#include "set"
#include "queue"
#include "vector"
#include "cctype"
#include "sstream"
#include "cstdlib"
#include "cstring"
#include "stack"
#include "ctime"
#include "algorithm"
#define pa pair<int,int>
#define Pi M_PI
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
using namespace std;
typedef long long LL;
const int M=55;
LL x,y;
LL exgcd(LL a,LL b)
{
LL t,d;
if(b==0)
{
x=1;
y=0;
return a;
}
d=exgcd(b,a%b);
t=x;
x=y;
y=t-(a/b)*y;
return d;
}
int main()
{
LL a,b,c,d;
while(cin>>a>>b>>c)
{
if(exgcd(a,b)!=1)
cout<<-1<<endl;
else
{
x=-x*(c/d);
y=-y*(c/d);
cout<<x<<' '<<y<<endl;
}
}
return 0;
}