#include <bits/stdc++.h>
using namespace std;
int a[400], b[400];
int main() {
  int i, n, j, k, l, t;
  cin >> n;
  k = 0;
  l = 0;
  j = 0;
  for (i = 1; i <= n; i++) cin >> a[i];
  for (i = 1; i <= n; i++) cin >> b[i];
  for (i = 1; i <= n; i++) {
    if ((a[i] - b[i]) > 0) k++;
    l += b[i];
    j += a[i];
  }
  if (k == 0)
    cout << -1 << endl;
  else {
    if (j > l)
      cout << 1 << endl;
    else {
      l = l - (j - k) + 1;
      if (l % k == 0)
        cout << l / k << endl;
      else
        cout << l / k + 1 << endl;
    }
  }
  return 0;
}
