D. Baklava Batches
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

It's baklava night at Hell's Kitchen, and the teams are struggling to get their dishes out. Customers have already placed $$$N$$$ orders for baklava, and they're getting impatient!

Specifically, each order specifies a quantity $$$a_i$$$, denoting how many baklavas the customer wants. The cooks have already prepared $$$N$$$ batches of baklava, but these batches may not have the correct quantity of orders for baklavas; the $$$i$$$th batch consists of $$$b_i$$$ baklavas.

In one operation, the cooks can move one baklava from any batch to any other batch (and these batches may be different between operations). In order to prevent the customers from walking out or rioting, they need to get an order out as quickly as possible. What is the minimum number of operations required to complete any order? An order is considered completed if the number of baklavas requested is equal to the quantity of baklavas in any batch.

Input

The first line consists of a single integer $$$N$$$, the number of orders and the number of batches. ($$$1 \le N \le 2 \cdot 10^5$$$).

The second line consists of $$$N$$$ integers $$$a_1,...,a_N$$$ ($$$1 \le a_i \le 10^9$$$), where $$$a_i$$$ denotes the number of baklavas ordered by the $$$i$$$th customer.

The third line consists of $$$N$$$ integers $$$b_1,...,b_N$$$ ($$$1 \le b_i \le 10^9$$$), where $$$b_i$$$ denotes the number of baklavas in the $$$i$$$th batch.

Output

Print out a single integer, the minimum number of operations required to complete any order, or -1 if it is not possible.

Examples
Input
4
1 2 3 4
5 6 7 8
Output
1
Input
4
5 6 7 8
1 2 3 4
Output
1