#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[101], b[101], ans1 = 0, ans2 = 0;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    cin >> b[i];
    a[i] -= b[i];
    if (a[i] < 0)
      ans2++;
    else if (a[i] > 0)
      ans1++;
  }
  if (ans1 == 0)
    cout << -1 << endl;
  else
    cout << ans2 / ans1 + 1 << endl;
}
