#BS0000069. Ăn nhanh (Gluttony)
Ăn nhanh (Gluttony)
Gluttony
Source: AtCoder
Version: Phuoc Hung OJ Extended
Problem Statement
There are member coefficients and food difficulties . Pair them bijectively; a pair takes seconds. At most training steps may decrease coefficients by one, not below zero. Minimize the maximum paired product.
Input
The first line contains . Then arrays and .
Output
Print the minimum possible score.
Subtasks
- Subtask 1 — 20%: .
- Subtask 2 — 30%: .
- Subtask 3 — 50%: , , .
Example
Input
3 5
4 2 1
2 3 1
Output
2
Explanation
An optimal training and pairing achieves maximum product 2.