Mr. Square is going on a holiday. He wants to bring 2 of his favorite squares with him, so he put them in his rectangle suitcase.
Write a function that, given the size of the squares and the suitcase, return whether the squares can fit inside the suitcase.
fit_in(a,b,m,n)
a,b are the sizes of the squares
m,n are the sizes of the suitcase
思路:最大边是两者之和,最小边是最大的方块的边
代码如下:
def fit_in(a,b,m,n):
MaxS=a+b
MinS=max(a,b)
MaxCase=max(m,n)
MinCase=min(m,n)
if MaxS > MaxCase or MinS > MinCase:
return False
return True