有大佬看看哪里错了吗
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<map>
#include<queue>
#include<algorithm>
#define ll long long
#define ull unsigned long long
using namespace std;
ll d,xx,yy;
ll exgcd(ll a,ll b,ll xx,ll yy){
if(b==0){
xx=1;
yy=2;
return a;
}
d=exgcd(b,a%b,xx,yy);
ll t=xx;
xx=yy;
yy=t-a/b*yy;
return d;
}
int main(){
ll n,m,x,y,l;
cin>>x>>y>>m>>n>>l;
ll b=n-m,a=x-y;
if(b<0)
{
b=-b;
a=-a;
}
exgcd(b,l,xx,yy);
if(a%d!=0)
{
cout<<"Impossible";
}
else cout<<((xx*(a/d))%(l/d)+(l/d))%(l/d);
}