legs = 64
for rabbits in range(0, legs // 4 + 1):
geese = (legs - 4 * rabbits) // 2
if 4 * rabbits + 2 * geese == legs:
print(f"Кроликів: {rabbits}, Гусей: {geese}")
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
legs = 64
for rabbits in range(0, legs // 4 + 1):
geese = (legs - 4 * rabbits) // 2
if 4 * rabbits + 2 * geese == legs:
print(f"Кроликів: {rabbits}, Гусей: {geese}")