SP8422 BTCODE_D - Maximum Profit
Description
Chakra is a young and dynamic entrepreneur, who is developing rapidly as a successful hotelier. He owns the Quickbyte chain of restaurants, 'M' of which are fully functional now. He divides each day into 'N' time slots. For each time slot 'j', in every restaurant 'i', there are A $ _{ij} $ waiters and B $ _{ij} $ customers. Being a quality conscious person, he wants each waiter to handle atmost one customer in a given time slot. Since he is really busy, in a day each restaurant is open only during one of the time slots. Since the hunger and demand for food varies during the day, the price which the customer is willing to pay varies, and is given by C $ _{ij} $ for a restaurant 'i' during a time slot 'j'.
Given the values of A $ _{ij} $ , B $ _{ij} $ and C $ _{ij} $ , find the maximum profit which Chakra can make in a day.
Input Format
The first line of input contains an integer 't', denoting the number of test cases.
For each testcase, the first line contains 2 space separated integers 'M' and 'N'.
Each of the next 'M' lines contains 'N' integers. The j $ ^{th} $ integer on the i $ ^{th} $ line denotes the value of A $ _{ij} $
Each of the next 'M' lines contains 'N' integers. The j $ ^{th} $ integer on the i $ ^{th} $ line denotes the value of B $ _{ij} $
Each of the next 'M' lines contains 'N' integers. The j $ ^{th} $ integer on the i $ ^{th} $ line denotes the value of C $ _{ij} $
Output Format
For each test case output one value, denoting the maximum profit which Chakra can make in a day.
More than one restaurant can be open during a given time slot.