/** * author: roccoshi * created: 2021-08-07 13:54:25 */ #pragma GCC diagnostic ignored "-Wsign-conversion" #pragma GCC diagnostic ignored "-Wsign-compare" #include using namespace std; #define ll long long // #define endl '\n' #define pii pair #define mp make_pair #define pb push_back #define fi first #define se second const int pi = 3.1415927; const int mod = 1e9 + 7; const int inf = 0x3f3f3f3f; const int ninf = 0xc0c0c0c0; const int N = 10000 + 5; const int M = 200000 + 5; int main() { ios::sync_with_stdio(false); cin.tie(0); int t; cin >> t; int a, b, c, d; while (t--) { cin >> a >> b >> c >> d; if (b < c) { cout << "no" << endl; } else if (a == 1) { if (b == c && c == d && b == d) { cout << "yes" << endl; } else { cout << "no" << endl; } } else { if ((a - 1) * c + b <= a * d && (a - 1) * b + c >= a * d) { cout << "yes" << endl; } else { cout << "no" << endl; } } } return 0; }