//http://judge.openfmi.net:9280/practice/get_problem_description?contest_id=63&problem_id=202 #include bool solve(int a, int b, int c, int d) { if (a > c) return false; if (b > d) return false; if (a == c && b == d) return true; return solve(a+b, b, c, d) || solve(a, a+b, c, d); } int main() { int t, a, b, c, d; scanf("%d", &t); while (t--) { scanf("%d%d%d%d", &a, &b, &c, &d); if (solve(a, b, c, d)) printf("YES\n"); else printf("NO\n"); } }