Checkout at an airport consists of two sequential events first passport check which takes time A minutes and there are B counters present for it. Second is luggage check which takes C minutes and there are D counters present for it.
Functioning of different counters is independent of each other and every passengers must go through both events in order i.e. first passport then luggage check.
Given N passengers and their arrival time A[i]. Find the minimum time in which all the passengers will get their both events done.
Input format
Output format
Print a single integer denoting the minimum time required to get all passengers done with both events.
Constraints
1≤A,C≤1091≤N,B,D≤1051≤A[i]≤109A[i−1]≤A[i]