#include <bits/stdc++.h>
using namespace std;
const int N = 110;
int n;
int a1[N];
int a2[N];
int ans;
int cnt;
int solve(int start, int cnt, int ans) {
  int sum = 0;
  for (int i = 0; i < cnt; i++) {
    sum += max(1, start - i);
    if (sum > ans) return 1;
  }
  return 0;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a1[i];
  for (int i = 1; i <= n; i++) cin >> a2[i];
  for (int i = 1; i <= n; i++) {
    if (a1[i] == a2[i]) continue;
    if (a1[i] > a2[i]) cnt++;
    if (a1[i] < a2[i]) ans++;
  }
  if (!cnt) {
    cout << -1;
    return 0;
  } else {
    for (int i = 1; i <= n; i++)
      if (i * cnt > ans) {
        cout << i;
        return 0;
      }
  }
}
