Skip to content

Commit

Permalink
67.py
Browse files Browse the repository at this point in the history
  • Loading branch information
huisuu committed Aug 30, 2024
1 parent 9ea63b2 commit 11912f4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions HSKIM/61to70/67.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
def solution(blue, white):
# 가로와 세로 길이의 합과 곱을 계산
perimeter = (blue + 4) // 2
area = blue + white

for x in range(1, perimeter):
if x * (perimeter - x) == area: # 방정식을 만족하는 x를 찾음
return [max(x, perimeter - x), min(x, perimeter - x)] # 가로가 더 길게 정렬하여 반환

print(solution(10, 2))

0 comments on commit 11912f4

Please sign in to comment.