#include // #include using namespace std; // using namespace atcoder; typedef long long ll; typedef long double ld; typedef vector vi; typedef vector vll; typedef vector vld; typedef vector vvi; typedef vector vvll; template using Vec = vector; template using Graph = Vec>; #define _overload3(_1,_2,_3,name,...) name #define _rep(i,n) repi(i,0,n) #define repi(i,a,b) for(int i=int(a);iint(b);--i) #define rrep(...) _overload3(__VA_ARGS__,rrepi,_rrep)(__VA_ARGS__) #define all(x) (x).begin(),(x).end() #define SORT(x) sort(all(x)) #define REVERSE(x) reverse(all(x)) templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b V) cout << "Overflow" << endl; else if (X + R*(Fi-Fo) <= 0) cout << "Zero" << endl; else cout << "Safe" << endl; } else if (D > 0) { if (X + R*(Fi-Fo) <= 0) cout << "Zero" << endl; else cout << "Overflow" << endl; } else { if (X + R*(Fi-Fo) > V) cout << "Overflow" << endl; else cout << "Zero" << endl; } } int main() { int T; cin >> T; rep(i, T) { ll V, X, Fo, Fi, Q, R; cin >> V >> X >> Fo >> Fi >> Q >> R; solve(V, X, Fo, Fi, Q, R); } }