Polycarp is preparing the first programming contest for robots. There are $n$ problems in it, and a lot of robots are going to participate in it. Each robot solving the problem $i$ gets $p_i$ points, and the score of each robot in the competition is calculated as the sum of $p_i$ over all problems $i$ solved by it. For each problem, $p_i$ is an integer not less than $1$.

Two corporations specializing in problem-solving robot manufacturing, "Robo-Coder Inc." and "BionicSolver Industries", are going to register two robots (one for each corporation) for participation as well. Polycarp knows the advantages and flaws of robots produced by these companies, so, for each problem, he knows precisely whether each robot will solve it during the competition. Knowing this, he can try predicting the results — or manipulating them. 

For some reason (which absolutely cannot involve bribing), Polycarp wants the "Robo-Coder Inc." robot to outperform the "BionicSolver Industries" robot in the competition. Polycarp wants to set the values of $p_i$ in such a way that the "Robo-Coder Inc." robot gets strictly more points than the "BionicSolver Industries" robot. However, if the values of $p_i$ will be large, it may look very suspicious — so Polycarp wants to minimize the maximum value of $p_i$ over all problems. Can you help Polycarp to determine the minimum possible upper bound on the number of points given for solving the problems?


-----Input-----

The first line contains one integer $n$ ($1 \le n \le 100$) — the number of problems.

The second line contains $n$ integers $r_1$, $r_2$, ..., $r_n$ ($0 \le r_i \le 1$). $r_i = 1$ means that the "Robo-Coder Inc." robot will solve the $i$-th problem, $r_i = 0$ means that it won't solve the $i$-th problem.

The third line contains $n$ integers $b_1$, $b_2$, ..., $b_n$ ($0 \le b_i \le 1$). $b_i = 1$ means that the "BionicSolver Industries" robot will solve the $i$-th problem, $b_i = 0$ means that it won't solve the $i$-th problem.


-----Output-----

If "Robo-Coder Inc." robot cannot outperform the "BionicSolver Industries" robot by any means, print one integer $-1$.

Otherwise, print the minimum possible value of $\max \limits_{i = 1}^{n} p_i$, if all values of $p_i$ are set in such a way that the "Robo-Coder Inc." robot gets strictly more points than the "BionicSolver Industries" robot.


-----Examples-----
Input
5
1 1 1 0 0
0 1 1 1 1

Output
3

Input
3
0 0 0
0 0 0

Output
-1

Input
4
1 1 1 1
1 1 1 1

Output
-1

Input
9
1 0 0 0 0 0 0 0 1
0 1 1 0 1 1 1 1 0

Output
4



-----Note-----

In the first example, one of the valid score assignments is $p = [3, 1, 3, 1, 1]$. Then the "Robo-Coder" gets $7$ points, the "BionicSolver" — $6$ points.

In the second example, both robots get $0$ points, and the score distribution does not matter.

In the third example, both robots solve all problems, so their points are equal.

Difficulty: interview

Starter code:

Solutions:
n=int(input())
r = [int(x) for x in input().split()]
s = [int(x) for x in input().split()]
a=0
b=0
for i in range(n):
    if r[i]==1 and s[i]==0:
        a+=1
    if r[i]==0 and s[i]==1:
        b+=1
if a==0:
    print(-1)
else:
    print((b)//a+1)

from math import ceil
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
p=0
m=0
for i in range(n):
    d=a[i]-b[i]
    if d>0:
        p+=d
    else:
        m-=d
if p==0:
    print(-1)
else:
    print(m//p+1)


import sys
import math
from collections import defaultdict
from collections import deque
from itertools import combinations
from itertools import permutations
input = lambda : sys.stdin.readline().rstrip()
read = lambda : list(map(int, input().split()))
go = lambda : 1/0
def write(*args, sep="\n"):
  for i in args:
    sys.stdout.write("{}{}".format(i, sep))
INF = float('inf')
MOD = int(1e9 + 7)
YES = "YES"
NO = "NO"

for _ in range(1):
  try:
    n = int(input())
    a = read()
    b = read()
    x = 0
    y = 0

    for i in range(n):
      if a[i] == 0 and b[i] == 1:
        y += 1
      elif a[i] == 1 and b[i] == 0:
        x += 1
    
    if x == 0:
      print(-1)
      go() 
    else:
      print(y // x + 1)
    

  except ZeroDivisionError:
    continue

  except Exception as e:
    print(e)
    continue

import math, collections, sys
input = sys.stdin.readline
n = int(input())
r = list(map(int, input().split()))
b = list(map(int, input().split()))
countr, countb = 0, 0
for i in range(n):
    if r[i] and not b[i]:
        countr+=1
    elif not r[i] and b[i]:
        countb+=1
if countr == 0:
    print(-1)
    return
print(countb//countr + 1)

#JMD
#Nagendra Jha-4096

 
import sys
import math

#import fractions
#import numpy
 
###File Operations###
fileoperation=0
if(fileoperation):
    orig_stdout = sys.stdout
    orig_stdin = sys.stdin
    inputfile = open('W:/Competitive Programming/input.txt', 'r')
    outputfile = open('W:/Competitive Programming/output.txt', 'w')
    sys.stdin = inputfile
    sys.stdout = outputfile

###Defines...###
mod=1000000007
 
###FUF's...###
def nospace(l):
    ans=''.join(str(i) for i in l)
    return ans
 
 
 
##### Main ####
t=1
for tt in range(t):
    n=int(input())
    #n,k,s= map(int, sys.stdin.readline().split(' '))
    a=list(map(int,sys.stdin.readline().split(' ')))
    b=list(map(int,sys.stdin.readline().split(' ')))

    c=0
    d=0

    for i in range(n):
        if(a[i]!=b[i]):
            if(a[i]==1):
                c+=1
            else:
                d+=1
    if c==0:
        print(-1)
        continue
    v=(d+1)//c
    if(v*c<d+1):
        print(v+1)
    else:
        print(v)
    
    
#####File Operations#####
if(fileoperation):
    sys.stdout = orig_stdout
    sys.stdin = orig_stdin
    inputfile.close()
    outputfile.close()

import sys
import os
import time
import collections
from collections import Counter, deque
import itertools
import math
import timeit
import random
import string

#########################
# imgur.com/Pkt7iIf.png #
#########################

def sieve(n):
    if n < 2: return list()
    prime = [True for _ in range(n + 1)]
    p = 3
    while p * p <= n:
        if prime[p]:
            for i in range(p * 2, n + 1, p):
                prime[i] = False
        p += 2
    r = [2]
    for p in range(3, n + 1, 2):
        if prime[p]:
            r.append(p)
    return r

def divs(n, start=1):
    divisors = []
    for i in range(start, int(math.sqrt(n) + 1)):
        if n % i == 0:
            if n / i == i:
                divisors.append(i)
            else:
                divisors.extend([i, n // i])
    return divisors

def divn(n, primes):
    divs_number = 1
    for i in primes:
        if n == 1:
            return divs_number
        t = 1
        while n % i == 0:
            t += 1
            n //= i
        divs_number *= t

def flin(d, x, default=-1):
    left = right = -1
    for i in range(len(d)):
        if d[i] == x:
            if left == -1: left = i
            right = i
    if left == -1:
        return (default, default)
    else:
        return (left, right)

def ceil(n, k): return n // k + (n % k != 0)
def ii(): return int(input())
def mi(): return list(map(int, input().split()))
def li(): return list(map(int, input().split()))
def lcm(a, b): return abs(a * b) // math.gcd(a, b)
def prr(a, sep=' '): print(sep.join(map(str, a)))
def dd(): return collections.defaultdict(int)
def ddl(): return collections.defaultdict(list)


input = sys.stdin.readline

n = ii()
a = li()
b = li()
ar = br = 0
for i in range(n):
    if a[i] == 1 != b[i]:
        ar += 1
    elif b[i] == 1 != a[i]:
        br += 1

if ar == 0:
    print(-1)
else:
    print(ceil(br + 1, ar))



input()
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ex1 = sum(i&~j for i, j in zip(a, b))
ex2 = sum(j&~i for i, j in zip(a, b))
try: print(ex2 // ex1 + 1)
except ZeroDivisionError: print(-1)


n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

a1 = 0
b1 = 0

for i in range(n):
    if a[i] == 0 and b[i] == 1:
        b1 += 1
    elif a[i] == 1 and b[i] == 0:
        a1 += 1

if a1 == 0:
    print(-1)
else:
    if a1 > b1:
        print(1)
    elif a1 == b1:
        print(2)
    else:
        print((b1//a1)+1)


import sys
n=int(sys.stdin.readline())
a=list(map(int,sys.stdin.readline().split()))
b=list(map(int,sys.stdin.readline().split()))
pa,pb=0,0
for i in range(n):
    if a[i]==0 and b[i]==1:
        pb+=1
    if a[i]==1 and b[i]==0:
        pa+=1
if pa==0:
    print(-1)
else:
    ans=(1*pb)//(pa)+1
    print(ans)


import string


def main():
    n = int(input())
    r = list(map(int, input().split()))
    b = list(map(int, input().split()))
    more = 0
    less = 0
    for i in range(n):
        if r[i] > b[i]:
            more += 1
        elif r[i] < b[i]:
            less += 1
    if more == 0:
        print(-1)
        return
    a = less/more + 1
    print(int(a))

def __starting_point():
    t = 1
    for i in range(t):
        main()

__starting_point()

n=int(input())
r=input().split()
b=input().split()
if(r.count('1')>b.count('1')):
    print(1)
else:
    x=b.count('1')-r.count('1')+1
    count=0
    for i in range(n):
        if(r[i]=='1' and b[i]=='0'):
            count+=1
    if(count==0):print(-1)
    else:
        if(x%count==0):print(x//count+1)
        else:print(x//count+1+1)

from sys import stdin
input = stdin.readline

input()
a = list(map(int, input().split()))
b = list(map(int, input().split()))

a_only = b_only = 0
for i, j in zip(a,b):
    if i == j:
        continue
    if i == 1:
        a_only += 1
    elif j == 1:
        b_only += 1

if a_only == 0:
    print(-1)
else:
    print( b_only//a_only + 1)


n = int(input())
rc = [int(i) for i in input().split()]
bs = [int(i) for i in input().split()]
r = 0
b = 0
for a in range(n):
    if rc[a] > bs[a]:
        r += 1
    elif rc[a] < bs[a]:
        b += 1
if r == 0:
    print(-1)
else:
    print(b//r+1)

n = int(input())
r = list(map(int, input().split()))
b = list(map(int, input().split()))

can_change = False
only_r_count = 0
only_b_count = 0
for i in range(n):
	if r[i] == 1 and b[i] == 0:
		only_r_count += 1
	elif b[i] == 1 and r[i] == 0:
		only_b_count += 1

if only_r_count == 0:
	print(-1)
else:
	print(only_b_count // only_r_count + 1)


from math import ceil
n = int(input())
apna = list(map(int,input().split()))
unka = list(map(int,input().split()))
cnt = 0
c = 0
for i in range(n):
	if unka[i]==1 and apna[i]==0:
		cnt+=1
	if apna[i]==1 and unka[i]==0:
		c+=1
cnt+=1
if cnt>0 and c==0:
	print(-1)
else:
	print(ceil(cnt/c))

import sys

# inf = open('input.txt', 'r')
# reader = (line.rstrip() for line in inf)
reader = (line.rstrip() for line in sys.stdin)
input = reader.__next__

n = int(input())
r = list(map(int, input().split()))
b = list(map(int, input().split()))
ctr = 1
share = 0
for i in range(n):
    if r[i] < b[i]:
        ctr += 1
    elif r[i] > b[i]:
        share += 1
if share == 0:
    print(-1)
else:
    score, rem = divmod(ctr, share)
    if rem == 0:
        print(score)
    else:
        print(score + 1)

# inf.close()


n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
aa = 0
bb = 0
for i in range(n):
    if a[i] != b[i] and a[i] == 1:
        aa+=1
    elif a[i] != b[i] and b[i] == 1:
        bb+=1
if aa == 0:
    print(-1)
else:
    print(bb // aa + 1)

import sys


def solve(N, R, B):
    less = 0
    eq = 0
    more = 0
    for i in range(N):
        if R[i] < B[i]:
            less += 1
        elif R[i] > B[i]:
            more += 1
        else:
            eq += 1
    if more == 0:
        return -1
    d, r = divmod(less, more)
    if r == 0:
        return d + 1
    return d + 1


def __starting_point():
    N, = list(map(int, input().split()))
    R = [int(x) for x in input().split()]
    B = [int(x) for x in input().split()]
    ans = solve(N, R, B)
    print(ans)

__starting_point()

n = int(input())
robo = list(map(int, input().split()))
bionic = list(map(int, input().split()))

only_bionic = sum(1 if b == 1 and robo[i] == 0 else 0 for i, b in enumerate(bionic))
only_robo = sum(1 if r == 1 and bionic[i] == 0 else 0 for i, r in enumerate(robo))
if only_robo == 0:
    print(-1)
    return
cost = only_bionic // only_robo + 1
print(cost)


from math import ceil
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
count1 = 0
count2 = 0
for i in range(n):
    if(a[i] == 1 and b[i] == 0):
        count1 += 1
    elif(a[i] == 0 and b[i] == 1):
        count2 += 1
if(count1 == 0):
    print(-1)
else:
    if(count2 % count1 == 0):
        print(1 + count2//count1)
    else:
        print(ceil(count2/count1))

n= int(input())
rc= list(map(int,input().split(' ')))
bc= list(map(int,input().split(' ')))
r,b=0,0
for i in range(n):
	if rc[i]==1 and bc[i]!=1:
		r+=1
	if rc[i]!=1 and bc[i]==1:
		b+=1
if r==0:
	print(-1)
else:
	if(r>b):
		print(1)
	else:
		print(int(b/r)+1)

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
pos, neg = 0, 0
for i in range(n):
    if a[i] == 1 and b[i] == 0:
        pos += 1
    elif a[i] == 0 and b[i] == 1:
        neg += 1
if pos == 0:
    print(-1)
else:
    ret = neg // pos
    if ret * pos <= neg:
        ret += 1
    print(ret)


for _ in range(1):
    n=int(input())
    a=list(map(int,input().split()))
    b=list(map(int,input().split()))
    ans=0
    k=0
    for i in range(n):
        if a[i]+b[i]!=2:
            if a[i]==1:
                ans+=1
            elif b[i]==1:
                k+=1
    if ans==0:
        print(-1)
    else:
        if k%ans==0:
            print(k//ans+1)
        else:
            print(k//ans+1)