Last active
August 11, 2019 06:47
-
-
Save maintainer64/6f3d7e378063ee933fe4a189b6f5509b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Для решения данной задачи необходимо на листе бумаги построить математическу модель, которая приведёт к результату. | |
Самое главное в этой задаче не меня ширину и высоту поля, поскольку **комбайн** не может повернуть поле | |
""" | |
def harvester_math(n:int, m:int) -> int: | |
if n <= m: | |
# n - small | |
return 2*(n - 1) | |
else: | |
# m - small | |
return 2*(m - 1) + 1 | |
assert harvester_math(3, 4) == 4, 'One test failed!' | |
assert harvester_math(5, 3) == 5, 'Two test failed!' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment