Schedule
Kozak Vus recently established his own company, which is expanding rapidly and now employs many people.
He has assigned tasks to his employees. Each task is characterized by two parameters: and . Here, represents the deadline by which the -th task should be completed, and indicates the importance of the task (with higher values of signifying greater importance).
Additionally, Kozak Vus has defined an integer constant .
The employees need to determine an array of non-negative numbers such that the following expression is minimized:
Here, denotes the maximum value in the array .
Kozak Vus is not interested in the array itself but wants to know the minimum possible value of the expression above.
Assist Kozak Vus's employees in solving this problem.
Input
The first line contains two integers and () — the number of tasks assigned by Kozak Vus to the employees, and the constant .
The second line contains integers () — the array .
The third line contains integers () — the array .
Output
Output a single number — the minimum possible value of the expression .
Examples
Note
In the first example, the array that achieves the minimum value is . The minimum value is .
In the second example, the array that achieves the minimum value is . The minimum value is .
In the third example, the array that achieves the minimum value is . The minimum value is .
Scoring
( points): ;
( points): ;
( points): ;
( points): ;
( points): no additional constraints.