Answer to Question #310171 in Python for Vandana

Question #310171




A basket contains of three fruits has to be created using apples and mangoes



Saurabh believes that the optimal fruit basket of three fruits should



consist of one


Apple and two mangoes. Adish believes that the two apples and one mango. fruit basket should have





There are A apples and B mangoes. Can you calculate what maximum number of imar.chine baskets that can be formed?



Input Format



The first line contains an integer, A, denoting the number of apples.





The next line contains an integer, B, denoting the the number of mangoes.



constrants



1 <=A<= 10^5



1 <= B <= 10^5



Sample





1



2



1









Sample Output








are only 2 fruits in total, hence no optimalees baskets can be



Only one optimal basket can be made be (A, M, M), where A represents an Apple, and M represents a Mango. niteeshkuma



3 optimal fruit baskets can be made i.e (A, M. M) (A, M, M), (A, A, M). where A represents an Apple, and M represents a Mango itees




1
Expert's answer
2022-03-12T12:46:37-0500
def opt_fru(A, B):
    sum1 = A + B
    if sum1 < 3:
        return 0
    else:
        return sum1/3
opt_fru(1,1)
0

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