The Bat club controls Gotham City. They decided to bring equality to the city (Of course, with some profits in their pocket). There are people in the city. The person has dollars in his/her bank account. To bring equality in the bank balance of the people of Gotham City, the Bat club appointed a collector. The Bat club has offered packages to the collector. The package has a value of and the collector has to pay dollars for the package. The collector has to choose a package. If the collector chooses the package, he has to make everyone’s bank balance equal to dollars. If a person has more than dollars in his/her bank account, the collector will take the rest of the money leaving dollars in his/her account. If a person has less than dollars, the collector will add the necessary amount of dollars to make the bank balance equal to dollars.
The collector wants to maximize his profit from this job. In case if he is unable to make any profit, he wants to minimize his loss. The collector asked your help to choose a package wisely and accurately estimate his maximum profit or minimum loss.
Please note that the collector must buy a package even if there is not a need for any changes in bank balances.
The first line of input will consist of two integers and .
The second line will consist integers .
The third line will consist of integers .
The fourth line will consist of integers .
In the case of profit, print . Here, stands for maximum profit the collector can make.
In the case of loss, print . Here, stands for minimum loss the collector has to face.
Otherwise, print . If there is no profit or loss.
Input | Output |
---|---|
5 2 3 2 2 4 1 8 2 3 4 | Profit 4 |
If the collector chooses the first package, he has to make everyone's bank balance equal to 3. To make everyone's bank balance equal to 3 dollars, he can adjust the bank balances of the account holders by adding the following amounts respectively: -2, +5, -1, 0, +1. That leaves 3 dollars in his pocket. Additionally, he has to pay 2 dollars to the Bat club. That leaves only 1 dollar of profit. And if he chooses the second package, he has to make everyone's bank balance equal to 2 dollars. To make everyone's bank balance equal to 2 dollars he can make -1, +6, 0, +1, +2. That leaves 8 dollars in his pocket. Additionally, he has to pay 4 dollars to the Bat club. That leaves 4 dollars of profit. So the answer is 4 dollars. |
Input | Output |
---|---|
3 1 2 1 2 3 1 | Loss 1 |
Input | Output |
---|---|
3 1 3 2 5 2 4 | Neutral |