Problem Explanation
Category: Easy
One have to find out maximum number of player which is even. Check the amount of left hand player right hand player. If the amount is not same then take a amount of player from ambidexters, which can make equal number for both left hand and right hand. after taking some player from ambidexters , if still there are some player remains in ambidexters then divide the player among left hand and right hand players.
If the amount of ambidexters player is zero the just squre the value which is minimum of left hand and right hand players.
Some test case
10 12 10
28
1 0 1
2
2 4 0
4
3 6 9
18
5 5 5
14
Source code link Click here
No comments:
Post a Comment