#include <bits/stdc++.h>
using namespace std;
const int MAXN = 110;
int n, a[MAXN], b[MAXN], sum1, sum2;
inline int read() {
  int x = 0, flag = 1;
  char ch = getchar();
  while (ch < '0' or ch > '9') {
    if (ch == '-') flag = -1;
    ch = getchar();
  }
  while (ch >= '0' and ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * flag;
}
signed main() {
  n = read();
  for (register int i = 1; i <= n; i++) a[i] = read();
  for (register int i = 1; i <= n; i++) b[i] = read();
  for (register int i = 1; i <= n; i++) {
    if (a[i] > b[i]) sum1++;
    if (a[i] < b[i]) sum2++;
  }
  if (sum1 == 0 or (sum1 == sum2 and sum1 == n)) {
    printf("-1\n");
    return 0;
  }
  if (sum1 > sum2) {
    printf("1\n");
    return 0;
  }
  for (register int i = 2; i <= 10000000; i++) {
    if (sum1 * i > sum2) {
      printf("%d\n", i);
      return 0;
    }
  }
  return 0;
}
