#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t, a, b, c, d, n, i, j, count, flag;
  string s;
  {
    cin >> n;
    long long int a[n], b[n];
    for (i = 0; i < n; i++) cin >> a[i];
    for (i = 0; i < n; i++) cin >> b[i];
    int rwin = 0, bwin = 0;
    for (i = 0; i < n; i++) {
      if (a[i] > b[i])
        rwin++;
      else if (a[i] < b[i])
        bwin++;
    }
    if (rwin == 0)
      cout << "-1" << endl;
    else {
      float res;
      if ((bwin + 1) % rwin != 0)
        res = ((bwin + 1) / rwin) + 1;
      else
        res = ((bwin + 1) / rwin);
      cout << res << endl;
    }
  }
  return 0;
}
