문제


풀이

def solution(brown, red):
    x, y = 3, 3
    while True:
        calcRed = (x-2)*(y-2)
        calcBrown = x*y-red

        if calcRed == red and calcBrown == brown:
            break
        elif x*y>red+brown:
            y += 1
            x = y
        else:
            x += 1
    answer = [x,y]

    return answer


Reference

https://hsin.hr/coci/archive/2010_2011/contest4_tasks.pdf