#include <bits/stdc++.h>
using namespace std;
int main() {
  int t = 1, i;
  while (t--) {
    int n;
    cin >> n;
    int a[n], b[n];
    for (i = 0; i < n; i++) {
      cin >> a[i];
    }
    for (i = 0; i < n; i++) {
      cin >> b[i];
    }
    int cnt1 = 0, cnt2 = 0;
    for (i = 0; i < n; i++) {
      if (a[i] > b[i])
        cnt1++;
      else if (b[i] > a[i])
        cnt2++;
    }
    if (cnt1 == 0)
      cout << "-1";
    else
      cout << (cnt2 / cnt1) + 1;
  }
  return 0;
}
