小红走网格 - 代码
#include <iostream> #include <algorithm> using namespace std; int main() { int T; cin >> T; while(T--) { int x, y, a, b, c, d; cin >> x >> y >> a >> b >> c >> d; if(y % __gcd(a, b) == 0 && x % __gcd(c, d) == 0) cout << "YES" << endl; else cout << "NO" << endl; } return 0; }