ИЕ
def generate_podarok():
a = 50 # pryaniks count
b = 30 # konfets count
c = 40 # mandarins count
podarok = 0
while a > 0 and b > 0:
podarok += 1
a -= 1
b -= 1
while b > 0 and c > 0:
podarok += 1
b -= 1
c -= 1
while a > 0 and c > 0:
podarok += 1
a -= 1
c -= 1
return podarok
print(generate_podarok())
def presents(a, b, c):
items_list = [a, b, c]
max_1 = max(items_list)
items_list.remove(max_1)
first_presents = max(items_list)
minus_max = max_1-first_presents
second_presents = min(minus_max, min(a, b, c))
return first_presents+second_presents