We have X Girls and Y Boys in a class. If more girls sit together they will not behave. Similarly if more boys sit together they will not behave.
Write a program/algorithm to get maximum same gender that will be seated if seating is done to efficiently to get them behave.
Example 1: 5 girls and 1 boy Expected Output: 3 Explanation: G G B G G G
Example 2: 7 girls and 3 boys Expected Output: 2 Explanation: G G B G B G G B G G