Answer to Question #290621 in Python for Mohan

Question #290621

There are M number of boys, N number of girls and P number of pets given. A pet race is held for a fun-filled Sunday in a town. Each pet animal is accompanied by two persons for the race. The organiser planning for the seating arrangements by making groups such that each group has three members, and among these members, there is at least one boy and at least one girl, the third member being a boy, a girl, or a pet. One bench is required for each such group. The task is to find the maximum number of benches required for this

1
Expert's answer
2022-01-25T08:31:29-0500
def maximum_benches(m, n, p):
    return min((m + n + p) // 3, m, n)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS