能移动到目标位置,就相当于两个线性丢番图方程有解 #include <iostream> using namespace std; long long gcd(long long a,long long b){ while(b>0){ long long t=b; b=a%b; a=t; } return a; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int t; cin>>t; while(t--){ long long x,y,a,b,c,d; cin>>x>...