def solution(w,h):
cdg = max(i for i in range(1,min(w,h)+1) if w%i==0 and h%i==0)
return w*h-int((w/cdg+h/cdg-1)*cdg)
'프로그래머스 > [코테]Level2' 카테고리의 다른 글
[Python] 전화번호 목록 (0) | 2020.10.23 |
---|---|
[Python] 삼각달팽이 (0) | 2020.10.23 |
[Python] 기능개발 (0) | 2020.10.23 |
[Python] 124나라의 숫자 (0) | 2020.10.23 |
[Python] 프린터 (0) | 2020.10.23 |