#include <bits/stdc++.h>
using namespace std;
int a[105], b[105];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
  }
  int tota = 0, totb = 0;
  int utang = 0;
  for (int i = 0; i < n; i++)
    if (b[i] > a[i]) utang++;
  utang++;
  int balasHutang = 0;
  for (int i = 0; i < n; i++) {
    totb += b[i], tota += a[i];
    if (a[i] > b[i]) balasHutang++;
  }
  int ans = 0;
  if (tota > totb)
    ans = 1;
  else if (!balasHutang)
    ans = -1;
  else if (utang % balasHutang)
    ans = ceil(float(utang) / float(balasHutang));
  else
    ans = (utang) / balasHutang;
  cout << ans << "\n";
  return 0;
}
