#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9, mod = 1e9 + 7, N = 3e5;
const long long linf = 1e18;
int n, xa, ya, xb, yb;
pair<long double, long double> res(int a, int v, int l, int r) {
  if (v == 0) {
    if (a > l && a < r) {
      return make_pair(-inf, inf);
    } else
      return make_pair(inf, inf);
  }
  long double t1 = ((long double)(l - a) / v);
  long double t2 = ((long double)(r - a) / v);
  return make_pair(min(t1, t2), max(t1, t2));
}
pair<long double, long double> update(pair<long double, long double> a,
                                      pair<long double, long double> b) {
  if (a > b) swap(a, b);
  if (a.second <= b.first) return make_pair(inf, inf);
  return make_pair(b.first, min(a.second, b.second));
}
int main() {
  pair<long double, long double> ans = make_pair(0, inf);
  cin >> n >> xa >> ya >> xb >> yb;
  for (int i = 1; i <= n; i++) {
    long double x, y, vx, vy;
    cin >> x >> y >> vx >> vy;
    ans = update(ans, res(x, vx, xa, xb));
    ans = update(ans, res(y, vy, ya, yb));
  }
  if (ans.second - ans.first < 1e-13) {
    cout << -1;
  } else
    cout << setprecision(10) << fixed << ans.first;
  return 0;
}
