#include <bits/stdc++.h>
int main() {
  int ch[500000], cp[500000];
  char kh[1000000], arr[1000000];
  int a = 0, b = 0, c, d, e, i = 0, j = 0, k = 0, l = 0, tep, temp, m, n, x, y;
  scanf("%d", &a);
  for (i = 0; i < a; i++) {
    scanf("%d", &cp[i]);
  }
  j = l = 0;
  for (k = 0; k < a; k++) {
    scanf("%d", &ch[k]);
    cp[k] -= ch[k];
    if (cp[k] > 0)
      j++;
    else if (cp[k] < 0)
      l++;
  }
  printf("%d\n", j == 0 ? -1 : ((l / j) + 1));
  return 0;
}
