← Back to List

17177번: 내접사각형 만들기 ↗

Solutions

Python 3
209 B | 209 chars
def solution(L):
  for i in range(1, L[0]):
    L2 = [*L, i]

    b,a,c,d = L2

    if b*(b*b-a*a-c*c-d*d) == 2*a*c*d:
      return i
  else:
    return -1


L = [*map(int,input().split())]
print(solution(L))