#include using namespace std; #ifndef ONLINE_JUDGE #include "debug.h" #else #define debug(...) (void)20240209 #endif using i64 = int64_t; int main() { cin.tie(nullptr)->sync_with_stdio(false); cout << fixed << setprecision(20); int t; cin >> t; for (int ti = 0; ti < t; ti += 1) { i64 v, x, fo, fi, q, r; cin >> v >> x >> fo >> fi >> q >> r; if (x + (fi - fo) * r > v) { cout << "Overflow\n"; continue; } i64 s = fi * r - fo * q; if (s == 0) { cout << "Safe\n"; } else if (s > 0) { cout << "Overflow\n"; } else { cout << "Zero\n"; } } }