Maximum Profit
InterviewTime limit1sMemory limit1024 MB
Given processor and monitor prices, pair them into the most systems possible and find the maximum total of the price products.
Problem
You know that a computer system consists of one processor unit and one monitor. The warehouse of the firm "ShumenSoft" holds processor units and monitors. The -th processor unit costs leva, and the -th monitor costs leva. The price of a computer system made from the -th processor unit and the -th monitor is . You must assemble as many computer systems as possible, so that their total value is as large as possible. Write a program profit that solves this problem.
Input
The first line contains two integers and , separated by one space. The second line contains integers , separated by single spaces. The third line contains integers , separated by single spaces.
Output
On one line of standard output, print two integers separated by one space: the maximum number of computer systems that can be assembled, and their maximum total value.