A flight company has to schedule a journey of N groups of people from the same source to the same destination. Here, A1, A2, ..., AN represents the number of people in each group. All groups are present at the source. The flight company has M planes where B1, B2, ..., Bm represents the capacity of each plane.
You are required to send all groups to destination with the following conditions:
Note: Multiple planes can fly together and also it is not necessary for planes to end their journey at the source.
Determine the minimum time required to send all groups from the source to the destination.
Input format
Output format
Print a single integer denoting minimum time required to send all groups to the destination. If it is not possible to perform this operation, then print -1.
Constraints
1≤N, M≤1e51≤Ai, Bi≤1e9
In T = 3.
Every plane can make 2 trips.
Plane with capacity 6 , send one group with capacity 6 and other with capacity 2.
Other two planes can send each group in single trip.
It is not possible to send groups in time unit less than 3