def solution(brown, yellow):
    answer = []
    total = brown + yellow
    for heigt in range(1, total // 2):
        width = 0
        if total % heigt == 0:
            width = total // heigt
            if width >= heigt:
                if brown == (width + heigt) * 2 - 4:
                    answer.append(width)
                    answer.append(heigt)
    return answer

2a4b977bf3991e67073a8882b040cb573ba59ba6
<mask token>

def solution(brown, yellow):
    answer = []
    total = brown + yellow
    for heigt in range(1, total // 2):
        width = 0
        if total % heigt == 0:
            width = total // heigt
            if width >= heigt:
                if brown == (width + heigt) * 2 - 4:
                    answer.append(width)
                    answer.append(heigt)
    return answer
