#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, c = 0, d = 0;
  cin >> n;
  long long int a[n], b[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  for (int i = 0; i < n; ++i) {
    cin >> b[i];
    if (a[i] - b[i] > 0)
      c++;
    else if (a[i] - b[i] < 0)
      d++;
  }
  if (c == 0)
    cout << -1 << endl;
  else {
    if (d - c < 0)
      cout << 1 << endl;
    else {
      double e = c, f = d;
      if (d % c == 0)
        cout << ceil(f / e) + 1 << endl;
      else
        cout << ceil(f / e) << endl;
    }
  }
  return 0;
}
