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